Skip to content

fix(dashboard): hide exact-review server details - #1263

Merged
vincentkoc merged 1 commit into
mainfrom
security/codeql-clawsweeper-error-projection-20260827
Aug 27, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
security/codeql-clawsweeper-error-projection-20260827

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

Related: https://github.com/openclaw/clawsweeper/security/code-scanning/98

What Problem This Solves

Fixes an issue where signed exact-review Worker requests could receive
stack-bearing or otherwise internal Durable Object error data when a queue
operation failed or returned a malformed server response.

Why This Change Was Made

The Worker now owns the externally reachable error projection: unexpected
failures return the fixed, bounded exact_review_queue_unavailable code while
the server records a bounded diagnostic category. Intentional non-JSON 4xx
responses and valid structured JSON 5xx responses retain their existing status,
headers, and body shape.

This does not change the generic JSON response helper or the Durable Object
transaction boundary.

User Impact

Callers of signed exact-review internal routes no longer receive stack traces,
server paths, or internal failure text. Existing structured queue errors remain
machine-readable and unchanged.

OpenClaw Bay Impact

None. The change is limited to signed /internal exact-review forwarding
failures and does not alter Bay data contracts, projections, or navigation.

Documentation Impact

Updated the active exact-review Worker error proof and executable harness to
cover the fixed public response, retained internal diagnostic category, baseline
success, and post-failure recovery. The source of truth remains
dashboard/worker.ts; rerun the proof when that boundary or route changes.

Evidence

  • Pre-fix reproduction on a22ff989bdf474dbe9c917f34199c7fea45c27c1:
    a signed request to /internal/exact-review/publications/list returned a
    stack-bearing rejection with a synthetic internal path.
  • Current head: 40d770463241a3cfca5ddd7ef3becc6f7e42676c.
  • Focused tests: 9 passed, 0 failed across the Worker/DO boundary and record
    export sibling path.
  • Sol/high autoreview: clean, 0.98 patch-correct confidence.
  • Independent high-reasoning test audit: clean on observable behavior,
    pre-fix regression, non-duplicate coverage, and no test-only production seam.
  • Repo-native committed-range review: nothing_found, high confidence, exact
    range a22ff989..40d77046.
  • Production LOC: +5/-4 (net +1). Tests: +108/-74. Proof/docs: +42/-29.
  • git diff --check, focused formatting/lint/type checks, and all three builds
    passed.
  • The full Linux pnpm run check passed static checks, builds, lint, changed
    coverage, and the coverage suite except one raw-sync infrastructure failure:
    apply-drift-refresh requires .git. That exact test passed after adding
    verification-only Git metadata. Hosted CI remains the canonical full gate.

Real Behavior Proof

  • Claim: a stack-bearing queue rejection never crosses the signed Worker
    response boundary, while a bounded internal failure event remains available.
  • Surface: real local Wrangler Worker, HMAC-authenticated
    /internal/exact-review/publications/list, and the real ExactReviewQueue
    Durable Object with SQLite storage.
  • Scenario: baseline list succeeds; one marked SQL read rejects with a
    synthetic stack and private marker; the Worker returns a fixed JSON 500; a
    recovery list succeeds.
  • Environment: AWS Crabbox Linux on exact head
    40d770463241a3cfca5ddd7ef3becc6f7e42676c; run run_e35fd7055126, lease
    cbx_251420c016b5, auto-released.
  • Observed: 9/9 focused tests passed; all six HTTP assertions passed:
    baseline 200, recovery 200, failure 500, JSON content type, fixed public
    error, and no internal marker or stack path in the response.
  • Artifact: Crabbox collected
    .artifacts/exact-review-do-json-errors/proof-summary.json plus the redacted
    transcript and internal diagnostic category.
  • Limits: local Cloudflare runtime and synthetic storage failure; no
    production request or production data was used.

@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 27, 2026
@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 7:06 AM ET / 11:06 UTC.

ClawSweeper review

What this changes

The PR makes the exact-review Worker replace rejected or malformed Durable Object 5xx responses with a fixed public error while retaining intentional structured JSON errors.

Merge readiness

✅ Ready for maintainer review

Keep open. This MEMBER-authored draft has a focused, evidence-backed security hardening patch; current main still forwards sanitized but potentially path-bearing failure text, and no blocking patch defect was found.

Priority: P2
Reviewed head: 40d770463241a3cfca5ddd7ef3becc6f7e42676c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A small, coherent security patch with strong stated boundary proof and focused regression coverage.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The PR body documents an after-fix real local Worker and Durable Object run with authenticated requests, injected storage failure, fixed-response assertions, and recovery; it identifies a redacted Crabbox artifact and run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The PR body documents an after-fix real local Worker and Durable Object run with authenticated requests, injected storage failure, fixed-response assertions, and recovery; it identifies a redacted Crabbox artifact and run.
Evidence reviewed 5 items Current main behavior: The base implementation serializes rejected and malformed 5xx queue failures with sanitizedServerError; that helper redacts credential patterns but retains non-secret internal paths and text.
Boundary fix and regression coverage: The PR projects rejected and malformed 5xx responses to exact_review_queue_unavailable, logs fixed diagnostic categories only, and tests rejected calls, malformed responses, structured 5xx preservation, and record-export propagation.
Runtime proof contract: The updated proof drives the signed Worker route through a real local Wrangler Worker and Durable Object, injects a stack-bearing storage failure, checks the fixed JSON response, and verifies recovery.
Findings None None.
Security None None.

Live Verification

Command: crabbox run --provider local-container --local-container-image node:24-bookworm --no-hydrate --timing-json --script docs/proof/exact-review-do-json-errors/run-proof.sh --require-artifact '.artifacts/exact-review-do-json-errors/proof-summary.json' --artifact-glob '.artifacts/exact-review-do-json-errors/**'

Result: FAIL (failed) — step 1 expect_output fixed_public_error: expected terminal output was not visible within 30 seconds: "fixed_public_error"

‹private command›: line 1: crabbox: command not found

Assertions:

  • FAIL expect_output: fixed_public_error

How this fits together

The dashboard Worker forwards authenticated exact-review and state operations to the ExactReviewQueue Durable Object. This boundary turns queue responses into internal HTTP responses for automation and public status projections.

flowchart LR
  A[Authenticated automation request] --> B[Dashboard Worker]
  B --> C[Queue response boundary]
  C --> D[Exact-review Durable Object]
  D --> E[Queue storage]
  C --> F[Bounded HTTP error]
  F --> G[Internal caller]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Change mix 5 files affected; production +5/-4, tests +108/-74, proof/docs +42/-29 The security behavior change is narrowly localized and accompanied by focused regression and runtime-proof updates.

Technical review

Best possible solution:

Land the narrow Worker-side fixed-error projection after normal maintainer review, preserving structured queue errors that are already intentional protocol responses.

Do we have a high-confidence way to reproduce the issue?

Yes, source-reproducible: current-main code returns sanitized failure text that does not remove arbitrary internal paths, and the supplied harness injects exactly that failure through the signed Worker-to-Durable-Object route. This read-only review did not execute the harness.

Is this the best way to solve the issue?

Yes. Projecting unexpected failures at the Worker response boundary is the narrowest maintainable fix because it leaves Durable Object transaction behavior and intentional structured error contracts intact.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a22ff989bdf4.

Labels

Label changes:

  • add P2: This is a targeted hardening fix for error disclosure on authenticated exact-review infrastructure.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body documents an after-fix real local Worker and Durable Object run with authenticated requests, injected storage failure, fixed-response assertions, and recovery; it identifies a redacted Crabbox artifact and run.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The PR body documents an after-fix real local Worker and Durable Object run with authenticated requests, injected storage failure, fixed-response assertions, and recovery; it identifies a redacted Crabbox artifact and run.

Label justifications:

  • P2: This is a targeted hardening fix for error disclosure on authenticated exact-review infrastructure.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The PR body documents an after-fix real local Worker and Durable Object run with authenticated requests, injected storage failure, fixed-response assertions, and recovery; it identifies a redacted Crabbox artifact and run.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body documents an after-fix real local Worker and Durable Object run with authenticated requests, injected storage failure, fixed-response assertions, and recovery; it identifies a redacted Crabbox artifact and run.

Evidence

What I checked:

  • Current main behavior: The base implementation serializes rejected and malformed 5xx queue failures with sanitizedServerError; that helper redacts credential patterns but retains non-secret internal paths and text. (dashboard/worker.ts:4438, a22ff989bdf4)
  • Boundary fix and regression coverage: The PR projects rejected and malformed 5xx responses to exact_review_queue_unavailable, logs fixed diagnostic categories only, and tests rejected calls, malformed responses, structured 5xx preservation, and record-export propagation. (dashboard/worker.ts:4439, 40d770463241)
  • Runtime proof contract: The updated proof drives the signed Worker route through a real local Wrangler Worker and Durable Object, injects a stack-bearing storage failure, checks the fixed JSON response, and verifies recovery. (docs/proof/exact-review-do-json-errors/README.md:1, 40d770463241)
  • Feature history: Recent history identifies the earlier exact-review queue error normalization and related Worker rejection containment work, providing routing context for this follow-up. (dashboard/worker.ts:4421, 4a6f9ecb165e)
  • Current review revision: The checked-out head matches the PR head and the worktree is clean. (40d770463241)

Likely related people:

  • Vincent Koc: Authored prior merged Worker rejection-containment work and has the strongest recent contribution history across this boundary. (role: recent security-boundary contributor; confidence: high; commits: b853345fa6e3, 40d770463241; files: dashboard/worker.ts, dashboard/error-safety.ts)
  • Yuval Dinodia: Authored the recent exact-review queue failure normalization commit that precedes this narrower projection change. (role: preceding error-normalization contributor; confidence: high; commits: 4a6f9ecb165e; files: dashboard/worker.ts, test/dashboard-worker-durable-object-error.test.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@vincentkoc
vincentkoc marked this pull request as ready for review August 27, 2026 11:18
@vincentkoc
vincentkoc merged commit 0bd84d4 into main Aug 27, 2026
18 checks passed
@vincentkoc
vincentkoc deleted the security/codeql-clawsweeper-error-projection-20260827 branch August 27, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant