Skip to content

[Security] Baseline hardening: headers, CI scanning, and local assets #6675

@unisone

Description

@unisone

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:

  1. Remote asset dependency (Control UI loads SVG from external CDN)
  2. Missing HTTP security headers (no baseline CSP/XFO/nosniff on gateway responses)
  3. Unused security tooling configs (actionlint + zizmor configs exist but aren't enforced in CI)
  4. 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.com SVG 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 existing zizmor.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: read only (CodeQL needs security-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:

  1. Re-open each PR individually with reference to this issue
  2. Or combine into a single "security hardening bundle" PR if preferred
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsecuritySecurity documentation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions