Skip to content

fix: reuse reviewed test credentials after surrounding edits - #2201

Merged
joshavant merged 8 commits into
mainfrom
fix/scan-reserved-host-credentials
Nov 13, 2026
Merged

joshavant merged 8 commits into
mainfrom
fix/scan-reserved-host-credentials

Conversation

@obviyus

@obviyus obviyus commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: editing a file containing previously reviewed synthetic credentials unnecessarily blocks ClawSweeper reviews because approvals depend on whole-file hashes.

User Impact

Previously reviewed synthetic values remain approved after surrounding edits and can appear in prompt context. New or changed credentials still require review, including credentials naming reserved or loopback hosts. TruffleHog and its native completion/error checks remain enabled.

Why This Change Was Made

The hostname exemption proposed earlier in this PR could admit unknown credentials for a real destination. This revision removes that exemption and binds approvals to the exact native Raw/RawV2 value pair, detector identity, observed decoder, and supported native metadata shape.

The 92 distinct value pairs were migrated from the existing reviewed fixture/attribution data at 8ba1ab445ed086863bbd9749237cfcb7096bae7a, including all 16 values retained by the earlier PR version. The six prior Postgres pairs are deliberately excluded because native normalization can discard an overriding query password while retaining the approved reported value. Those findings remain blocked and require separately reviewed source-bound qualification. Source paths for the 92 eligible pairs are provenance only. Whole-file hashes, repeated source attributions, and the URI patch-witness machinery are removed. The Git object-ID metadata classification and masked native replay remain.

Accepted security findings are addressed:

  • SQL Server password suffix bypass: a password ending in @example.test can no longer make a real JDBC destination qualify.
  • Destination overrides: Postgres hostaddr and JDBC Cloud SQL socket-factory properties cannot gain an exemption from the apparent URI hostname.
  • Normalized Postgres password bypass: a native reproduction changed the query password while retaining the approved Raw/RawV2 identity. All Postgres global approvals are removed, with regression and native proof coverage.
  • Unsafe premise: .test and loopback do not establish that a credential is synthetic; private DNS and local database proxies are possible. No hostname is an approval rule.

Postgres false positives are an explicit remaining limitation: the six normalized pairs no longer qualify automatically.

This remains an intentional policy simplification: approvals follow an exact reviewed synthetic value across files and material roles. It does not automatically approve new test passwords.

The independent review also identified and this revision fixes two compatibility regressions (empty URI usernames and Privacy findings without a verification error) and strengthens the proof harness to reject infrastructure failures instead of counting them as negative-control success.

Documentation Impact

Updated the active README scanner contract and this PR's changelog fragment. The historical, reproducible native proof harness identifies the owning implementation and rerun triggers. Earlier qualification proofs tied to the removed file-hash policy are removed by the original PR.

Evidence

  • Focused classifier and Git metadata tests: 32 passed. Coverage includes native metadata drift, verified findings, completion failures, migration integrity, exact-value reuse, password-only URIs, the Privacy detector without a verification error, arbitrary reserved/loopback refusal, and Git metadata replay.
  • Build and pnpm run check:fast: passed.
  • Full pnpm run check: passed on Node 24.22.1 in the task-owned UTM guest: 6,198 tests, 6,176 passed, 22 skipped, zero failures or cancellations.
  • Independent Codex review: AutoReview using Codex gpt-6.1-sol, medium reasoning, P0–P3: scoped-clean, all four passes completed with zero findings. Reviewed the entire committed merge-base-to-HEAD range from pinned base 8ba1ab445ed086863bbd9749237cfcb7096bae7a through 1ccf77313d8b0736a8ea8340b93dc16be218fe65, with a clean source tree and current repository policy. The review did not execute project code; runtime validation is recorded separately below.

Real Behavior Proof

  • Claim: a reviewed synthetic value survives unrelated edits; unknown credentials do not qualify through reserved/loopback hostnames or destination parsing tricks.
  • Surface: production scanAgentInput, including native scanner invocation and full committed-range Git staging, plus prompt-only admission. This goes beyond feeding canned findings to the classifier.
  • Candidate: clean committed head 1ccf77313d8b0736a8ea8340b93dc16be218fe65.
  • Environment: task-owned UTM VM clawsweeper-pr2201-20261112, UUID 0201A977-496A-4C7C-8416-025C52065B50; Ubuntu Linux arm64, Node v24.22.1. No host Docker or production services used. Provider: UTM; no Crabbox run.
  • Scanner: checksum-verified TruffleHog 3.99.4; Linux arm64 archive SHA-256 e6285aff62e692131255dca91ad300a62a479330e0b72e4eb1d60ae58908f8d5; executed binary SHA-256 b57ff51268b83496fd58889b252e61549cd1071467aed4f4706b1df53ec13150.
  • Command: pnpm run build, then PATH="/home/dev/bin:$PATH" node docs/proof/input-scan-approved-values/run-proof.mjs --out /home/dev/final-native-proof.json.
  • Artifact/trace: the committed harness reproduces the receipt; its complete per-scenario admission outcomes are transcribed below. Receipt reports sourceDirty: false, the candidate head above, and passed: true.
Synthetic scenario Prompt Committed Git range
Exact reviewed value admitted admitted
Same value, unrelated surrounding edit admitted admitted
Reviewed password-only URI admitted admitted
Changed approved password refused: findings refused: findings
Unreviewed reserved hostname refused: findings refused: findings
Unreviewed .test hostname refused: findings refused: findings
Unreviewed loopback refused: findings refused: findings
Normalized Postgres fixture refused: findings refused: findings
Normalized Postgres with overriding query password refused: findings refused: findings
Normalized Postgres with target override refused: findings refused: findings
SQL Server password ending in @example.test refused: findings refused: findings
Postgres hostaddr override refused: findings refused: findings
JDBC Cloud SQL destination properties refused: findings refused: findings
Nonreserved hostname control refused: findings refused: findings

Observed: 28/28 expected results. Limits: synthetic input and scanner admission only; no model call, working remote database, or live database authentication. Verified findings and scanner-failure contracts are additionally exercised by focused tests. The native proof is representative of approval and rejection behavior, not an exhaustive scan of every historical fixture.

Hosted re-review was requested at #2201 (comment). It stopped at the deployed input scanner before model review. New synthetic source literals now assemble at runtime and the two new files scan cleanly. The remaining blocker is exact source qualification of existing retired scanner fixtures on main; #2204 provides that prerequisite. Its committed native proof admits this complete PR range and exact fixtures while refusing edited source, changed passwords, and different paths; it requires a separate reviewed merge before hosted re-review can proceed. No scanner switch or verification rule is disabled.

Draft retained for maintainer review; this update does not merge or enable automerge.

obviyus and others added 3 commits November 11, 2026 15:23
TruffleHog refuses credentials it cannot test. For test data that is
almost always because the host does not exist, so every edit to a test
file containing one needed another hash-bound allowlist entry (83 commits
since 2026-08-29).

Classify an unverifiable JDBC/URI/MongoDB/FTP/Postgres finding as
non-sensitive when every host it names is reserved for testing or
loopback (RFC 2606/6761, 127.0.0.0/8, ::1). Verified findings, other
detectors, public or unparseable hosts and incomplete scans still refuse.

Remove the per-file allowlist, the URI patch-witness machinery, the
reviewed-URI prompt omission, their tests and their fixture proofs. Keep
the native scan-contract checks and the Git object ID metadata path.

Co-authored-by: obviyus <[email protected]>
A few reviewed test values need a real hostname (GitHub detail tests,
browserless.io, autoreview's bare host, an Azure and a 10.x host, a
GrillTrack event UUID), so the reserved-host rule cannot judge them.
Keep them as a short list bound to the exact native value pair rather
than to a file. Also drop the prompt omission of reviewed URIs, which
only existed because the allowlist could not admit prompt material.

Co-authored-by: obviyus <[email protected]>
Stopping at a quote let a crafted value such as
postgres://localhost':[email protected] be judged by "localhost".
Read the authority up to the path, query or fragment, as URL parsers do,
and let the strict host check reject anything odd inside it.

Co-authored-by: obviyus <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@obviyus

obviyus commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 11, 2026
Keeps the scanner from flagging this PR's own test inputs.

Co-authored-by: obviyus <[email protected]>
@obviyus

obviyus commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@joshavant joshavant changed the title fix: reviews stop on test credentials for hosts that cannot exist fix: reuse reviewed test credentials after surrounding edits Nov 13, 2026
@joshavant

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@joshavant
joshavant marked this pull request as ready for review November 13, 2026 04:57
@joshavant
joshavant merged commit ce27649 into main Nov 13, 2026
26 checks passed
@joshavant
joshavant deleted the fix/scan-reserved-host-credentials branch November 13, 2026 04:57
obviyus added a commit that referenced this pull request Nov 14, 2026
* fix(review): qualify exact push relay rejection fixture

* fix: report the real checkout inspection failure reason

- Lead the read-only checkout inspection failure message with the runner error when present.
- Keep a redacted 2000-character stdout/stderr tail as context; keep stderr || stdout when no error.
- OpenClaw prints a plugin trust warning to stderr on every run, which hid every inspection reason.
- Add runner tests for OpenClaw and Codex inspection failures.

* fix: qualify the historical OCE harness origin fixture (#2197)

* test: clear dashboard token watchdog after completion (#2196)

Co-authored-by: Ryan Saari <[email protected]>

* fix: qualify exact OCE 5398 JDBC fixture revisions (#2198)

* fix(dashboard): normalize dashboard strict paths to POSIX slashes (#2177)

* fix: use server-issued census observation windows (#2174)

* fix: bound census observations with server-issued query windows

Replace cross-host completion-clock comparisons for negotiated census producers with stored metadata and per-assignment observation windows. Preserve strict legacy fallback, lease/checkpoint/identity fences, stable witnesses, and capacity bounds. Include signed native temporal red/green and rolling-compatibility proof.

Co-authored-by: brokemac79 <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>

* fix: use server-issued census observation windows

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 9c3c62ec-951b-43b0-98f9-511dba1829cf

* fix: preserve negotiated census authority across legacy upgrades

Add real workerd cold-restart proof that persisted deployed legacy-v2 checkpoints, cursors, identities and receipts load unchanged and safely continue through negotiated windows. Require the atomic lease mode before accepting any page, including legacy-shaped in-flight data before next issues a witness. Resolves the accepted data-model compatibility proof blocker without state reset or weakened legacy guards.

Co-authored-by: brokemac79 <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>

* Publish openclaw/coverage-observation-window-fix

Worked on by:
- @brokemac79

Co-authored-by: brokemac79 <[email protected]>
OpenClaw-Publication: 281f1b7a-6346-42af-b919-9fd25dd6b736

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: brokemac79 <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>

* fix(test): normalize test runner paths to POSIX slashes (#2176)

* fix: terminal acknowledgement test passes on a timeout instead of the real retry failure (#2199)

* test: exercise terminal acknowledgement retries without delay

* test: use the real retry helper with Retry-After: 0

The retry helper honors Retry-After, so the fixture no longer needs a
patched copy of the helper and request builder. The unchanged workflow
step and helper now run all six attempts without waiting.

Co-authored-by: Ryan Saari <[email protected]>
Co-authored-by: obviyus <[email protected]>

---------

Co-authored-by: Ryan Saari <[email protected]>
Co-authored-by: obviyus <[email protected]>

* improve: shorten reservation workflow test runtime (#2200)

* test: avoid reservation fixture retry waits

* test: record reservation retry waits with a PATH sleep shim

Replace the BASH_ENV sleep function and the hand-maintained per-scenario
attempt table with a sleep shim on the step's PATH. Every recorded delay
is still checked against the workflow's 2n + 0..3 backoff, and the
service-unavailable scenario must record all four waits.

Co-authored-by: Ryan Saari <[email protected]>
Co-authored-by: obviyus <[email protected]>

---------

Co-authored-by: Ryan Saari <[email protected]>
Co-authored-by: obviyus <[email protected]>

* fix(review): stop demanding proof for speculative races and in-flight revocation (#2202)

* fix(review): stop demanding proof for speculative races and in-flight revocation

Authority-chain review now triggers only on changed authorization
decisions; revocation applies to the next request; unproven authority is
no longer a merge gate. P3 findings are advisory, speculative race
machinery without recorded buy-in and preemptive single-use helpers become
findings, and AGENTS.md adopts the matching design rules.

Co-authored-by: obviyus <[email protected]>

* fix(review): keep advisory P3 findings out of the merge readiness gate

Co-authored-by: obviyus <[email protected]>

* fix(review): keep P3-only incorrect verdicts and queued repairs advisory

Co-authored-by: obviyus <[email protected]>

---------

Co-authored-by: obviyus <[email protected]>

* fix: reuse reviewed test credentials after surrounding edits (#2201)

Approve exact previously reviewed synthetic Raw/RawV2 value pairs while retaining detector, decoder, native metadata, verification, and completion checks. Remove hostname-based exemptions and keep normalized Postgres findings blocking.

Validation: full pnpm check, 32 focused tests, 28 native proof cases in an isolated UTM guest, and a clean final committed whole-branch Codex review. The maintainer explicitly waived the hosted ClawSweeper review and approved this merge in the task conversation.

* feat(review): read durable Gitcrawl cluster service context

* fix(review): validate service tokens without control regex

* fix: allow service-backed review-start reservations

* style: format service review-start reservation proof

* fix: allow service-backed review artifact publication

* feat: prepare service context before applying decisions

* fix: preserve parent identity during apply preparation

* fix: wire apply preparation to the shared relation policy

* test: cover service-backed apply and authority drift

* test: hold paired closes without prepared service context

* test: align service apply fixtures with live revision guards

* docs: explain apply preparation failure ownership

* fix: enforce apply retry guards without mutation receipts

* style: format service freshness assertion

* test: exercise service retries with a current review lease

* fix: refresh apply authority after ambiguous writes

* style: format service lease regression fixture

* test: reject exact-event retries after lease revocation

* style: format exact-event retry assertion

---------

Co-authored-by: Mitchell Etzel <[email protected]>
Co-authored-by: Free Wortley <[email protected]>
Co-authored-by: Ryan S <[email protected]>
Co-authored-by: Ryan Saari <[email protected]>
Co-authored-by: Saiyam Jain <[email protected]>
Co-authored-by: RoboClaw <[email protected]>
Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: brokemac79 <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: obviyus <[email protected]>
obviyus added a commit that referenced this pull request Nov 14, 2026
Bump EXACT_REVIEW_RETRY_POLICY_EPOCH to 2 after the exact-value scan
approvals (#2201). 684 items are held as scanner_refused under the old
file-bound policy; the epoch change lets each be re-admitted on its next
scheduled offer. Command-started holds still need a fresh command.

Co-authored-by: obviyus <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants