Repository navigation
Conversation
- Replace execSync with execFileSync in cli-credentials.ts to prevent shell injection via CODEX_HOME or keychain service names. The account value (derived from an env var) was interpolated into a shell command string; now passed safely as an argv array element. - Convert scripts/update-clawtributors.ts run() helper from execSync (shell string) to execFileSync (binary + args array). Inputs like seedCommit and rootCommit from JSON config / git output were interpolated directly into shell commands. - Fix icacls call in audit.test.ts to use execFileSync, preventing path injection on Windows. - Add X-Frame-Options: DENY to setDefaultSecurityHeaders() so all gateway HTTP responses deny framing by default (clickjacking protection). The control UI already set this; now it applies globally. Handlers that serve framed content can override. https://claude.ai/code/session_01UZ2Bf7rHM151gogeybi3Fn
…dentity - Add Content-Type validation to readJsonBodyOrError(): reject non-JSON Content-Type (e.g. application/x-www-form-urlencoded) with HTTP 415 before body parsing. Missing Content-Type is still accepted for CLI/script backwards compat. Prevents cross-origin form submissions from being silently parsed as JSON. - Replace OpenClaw README with VoltClaw README that documents the fork identity, security hardening changes, and project structure. https://claude.ai/code/session_01UZ2Bf7rHM151gogeybi3Fn
Greptile SummaryThis PR applies genuine security hardening across three areas: replacing Key issues found:
Confidence Score: 2/5
Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/gateway/http-common.ts
Line: 8-20
Comment:
**Canvas/A2UI routes will break — `X-Frame-Options: DENY` is never overridden**
`setDefaultSecurityHeaders` is invoked once at the very top of `handleRequest` in `server-http.ts` (line 613) for **every** incoming request, including canvas and A2UI routes. The comment on lines 9–10 accurately describes the intent — "Handlers that intentionally serve framed content (canvas host, A2UI) should override or remove it after calling this function" — but neither `src/canvas-host/server.ts` nor `src/canvas-host/a2ui.ts` call `res.removeHeader("X-Frame-Options")` or `res.setHeader("X-Frame-Options", "SAMEORIGIN")` anywhere in their response paths. Because `setHeader` replaces and the canvas handlers never touch this header, all canvas/A2UI responses will carry `X-Frame-Options: DENY`, causing any browser that loads canvas content inside an `<iframe>` to block it.
The previous version of the comment explicitly explained why this header was _excluded_:
> "Headers that restrict framing or set a Content-Security-Policy are intentionally omitted here because some handlers (canvas host, A2UI) serve content that may be loaded inside frames."
This PR removes that safeguard without making the canvas/A2UI handlers exempt.
To fix this without breaking canvas functionality, the canvas and A2UI handlers need to remove or relax the header for their own responses, e.g. in `handleA2uiHttpRequest` and `canvasHost.handleHttpRequest`:
```ts
// In canvas/A2UI handlers, after setDefaultSecurityHeaders has already run:
res.removeHeader("X-Frame-Options");
```
Or, alternatively, scope `X-Frame-Options: DENY` only to non-canvas paths in `server-http.ts` rather than applying it globally.
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: c6a3b74 |
| * X-Frame-Options defaults to DENY to prevent clickjacking on API/UI routes. | ||
| * Handlers that intentionally serve framed content (canvas host, A2UI) should | ||
| * override or remove it after calling this function. | ||
| * | ||
| * Content-Security-Policy is intentionally omitted because framing policy | ||
| * differs per handler; the control UI sets its own strict CSP. | ||
| */ | ||
| export function setDefaultSecurityHeaders( | ||
| res: ServerResponse, | ||
| opts?: { strictTransportSecurity?: string }, | ||
| ) { | ||
| res.setHeader("X-Content-Type-Options", "nosniff"); | ||
| res.setHeader("X-Frame-Options", "DENY"); |
There was a problem hiding this comment.
Canvas/A2UI routes will break — X-Frame-Options: DENY is never overridden
setDefaultSecurityHeaders is invoked once at the very top of handleRequest in server-http.ts (line 613) for every incoming request, including canvas and A2UI routes. The comment on lines 9–10 accurately describes the intent — "Handlers that intentionally serve framed content (canvas host, A2UI) should override or remove it after calling this function" — but neither src/canvas-host/server.ts nor src/canvas-host/a2ui.ts call res.removeHeader("X-Frame-Options") or res.setHeader("X-Frame-Options", "SAMEORIGIN") anywhere in their response paths. Because setHeader replaces and the canvas handlers never touch this header, all canvas/A2UI responses will carry X-Frame-Options: DENY, causing any browser that loads canvas content inside an <iframe> to block it.
The previous version of the comment explicitly explained why this header was excluded:
"Headers that restrict framing or set a Content-Security-Policy are intentionally omitted here because some handlers (canvas host, A2UI) serve content that may be loaded inside frames."
This PR removes that safeguard without making the canvas/A2UI handlers exempt.
To fix this without breaking canvas functionality, the canvas and A2UI handlers need to remove or relax the header for their own responses, e.g. in handleA2uiHttpRequest and canvasHost.handleHttpRequest:
// In canvas/A2UI handlers, after setDefaultSecurityHeaders has already run:
res.removeHeader("X-Frame-Options");Or, alternatively, scope X-Frame-Options: DENY only to non-canvas paths in server-http.ts rather than applying it globally.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/gateway/http-common.ts
Line: 8-20
Comment:
**Canvas/A2UI routes will break — `X-Frame-Options: DENY` is never overridden**
`setDefaultSecurityHeaders` is invoked once at the very top of `handleRequest` in `server-http.ts` (line 613) for **every** incoming request, including canvas and A2UI routes. The comment on lines 9–10 accurately describes the intent — "Handlers that intentionally serve framed content (canvas host, A2UI) should override or remove it after calling this function" — but neither `src/canvas-host/server.ts` nor `src/canvas-host/a2ui.ts` call `res.removeHeader("X-Frame-Options")` or `res.setHeader("X-Frame-Options", "SAMEORIGIN")` anywhere in their response paths. Because `setHeader` replaces and the canvas handlers never touch this header, all canvas/A2UI responses will carry `X-Frame-Options: DENY`, causing any browser that loads canvas content inside an `<iframe>` to block it.
The previous version of the comment explicitly explained why this header was _excluded_:
> "Headers that restrict framing or set a Content-Security-Policy are intentionally omitted here because some handlers (canvas host, A2UI) serve content that may be loaded inside frames."
This PR removes that safeguard without making the canvas/A2UI handlers exempt.
To fix this without breaking canvas functionality, the canvas and A2UI handlers need to remove or relax the header for their own responses, e.g. in `handleA2uiHttpRequest` and `canvasHost.handleHttpRequest`:
```ts
// In canvas/A2UI handlers, after setDefaultSecurityHeaders has already run:
res.removeHeader("X-Frame-Options");
```
Or, alternatively, scope `X-Frame-Options: DENY` only to non-canvas paths in `server-http.ts` rather than applying it globally.
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f4e8408bb4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| opts?: { strictTransportSecurity?: string }, | ||
| ) { | ||
| res.setHeader("X-Content-Type-Options", "nosniff"); | ||
| res.setHeader("X-Frame-Options", "DENY"); |
There was a problem hiding this comment.
Preserve frame access for canvas and A2UI responses
Adding X-Frame-Options: DENY in the shared default headers path applies to every HTTP request (the gateway sets defaults before routing), including /__openclaw__/a2ui/* and canvas-host responses, but those handlers do not clear/override the header. That causes browsers to block iframe embedding for these routes, which regresses framed canvas/A2UI integrations that previously worked.
Useful? React with 👍 / 👎.
| @@ -1,559 +1,81 @@ | |||
| # 🦞 OpenClaw — Personal AI Assistant | |||
| # VoltClaw | |||
There was a problem hiding this comment.
Keep README clawtributors marker block present
This README rewrite removes the <p align="left">...</p> clawtributors section that scripts/update-clawtributors.ts still requires (indexOf('<p align="left">') and throws when absent), so the contributor update workflow now fails against the new README format. If the new format is intentional, the script needs to be updated in the same change.
Useful? React with 👍 / 👎.
Summary
Describe the problem and fix in 2–5 bullets:
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
List user-visible changes (including defaults/config).
If none, write
None.Security Impact (required)
Yes/No)Yes/No)Yes/No)Yes/No)Yes/No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No)Yes/No)Yes/No)Failure Recovery (if this breaks)
Risks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.