-
-
Notifications
You must be signed in to change notification settings - Fork 69.3k
[Security] Baseline hardening: headers, CI scanning, and local assets #6675
Description
Summary
Following the CLAWDINATOR guidance to open an issue first before submitting security-related PRs. This proposal bundles 4 complementary security hardening improvements that reduce supply-chain and runtime risks.
Motivation
OpenClaw has 500k+ lines of code across multiple platforms with browser automation, command execution, and WebSocket control plane. While the project already has excellent security foundations (detect-secrets, openclaw security audit, loopback-by-default), there are baseline gaps that could be closed with minimal risk:
- Remote asset dependency (Control UI loads SVG from external CDN)
- Missing HTTP security headers (no baseline CSP/XFO/nosniff on gateway responses)
- Unused security tooling configs (actionlint + zizmor configs exist but aren't enforced in CI)
- No dependency vulnerability scanning (no CodeQL or dependency-review in CI)
Proposed Changes
Phase 1: Supply Chain Hardening (docs + CI)
1. Localize Control UI logo asset (addresses #5170)
- Replace hardcoded
mintcdn.comSVG URL with bundled local asset - PR reference: #6166 (closed), #6161 (alternative implementation)
- Risk reduced: Removes external CDN dependency that could be compromised
2. Wire up existing CI security configs
- Add
.github/workflows/actionlint.yml(uses existing.github/actionlint.yaml) - Add
.github/workflows/zizmor.yml(uses existingzizmor.yml) - PR reference: #6194 (closed, CI was fixed)
- Risk reduced: Catches workflow security footguns and misconfigurations
Phase 2: Runtime + Dependency Hardening
3. Add baseline HTTP security headers
- Add conservative headers to gateway HTTP responses:
X-Content-Type-Options: nosniff,Referrer-Policy,X-Frame-Options: SAMEORIGIN,Permissions-Policy - Intentionally scoped to be safe for both Control UI and API routes
- PR reference: #6171 (closed, had review feedback incorporated)
- Risk reduced: Reduces clickjacking, content-sniffing, and feature abuse surface
4. Add dependency scanning
- Add
.github/workflows/dependency-review.yml(GitHub official action) - Add
.github/workflows/codeql.yml(JavaScript/TypeScript analysis) - PR reference: #6195 (closed, CI was green)
- Risk reduced: Catches vulnerable dependencies and common insecure code patterns
Implementation Notes
- All changes are additive - no breaking changes to existing functionality
- Minimal permissions - CI workflows use
contents: readonly (CodeQL needssecurity-events: write) - Follows existing patterns - Uses same action versions and config styles as current CI
- Tested - All PRs were validated with
pnpm build,pnpm lint, and targeted tests
Request for Maintainers
@steipete (or active maintainers) - would you be open to these 4 hardening PRs? If yes, I can:
- Re-open each PR individually with reference to this issue
- Or combine into a single "security hardening bundle" PR if preferred
- Or adjust scope based on your feedback
The goal is to reduce "death by a thousand cuts" security risks while keeping the PRs small and reviewable.
References
- Security docs: https://docs.openclaw.ai/gateway/security
- Related issue: [Bug]: Possible security problem with the .svg file #5170 (remote SVG)
- Closed PRs with full implementation: security(ui): remove remote mintcdn asset reference #6166, security(gateway): add baseline HTTP security headers #6171, ci(security): add actionlint + zizmor workflows #6194, ci(security): add dependency review + CodeQL #6195