sec (3/9): require an active {{target}} in user-defined scanners#27
Conversation
336225f to
302c0ad
Compare
A BYOS command that never expands {{target}} outside quotes and comments can
return valid JSON and be recorded as a completed scan that never received the
target. Replace scannerTargetPlaceholdersAreUnquoted with
scannerTargetPlaceholderState, which reports both whether every placeholder is
unquoted and how many are active, and reject commands with zero active
placeholders.
3534adf to
17a2615
Compare
|
Codex review: needs changes before merge. Reviewed July 25, 2026, 10:37 PM ET / July 26, 2026, 02:37 UTC. ClawSweeper reviewWhat this changesThe branch validates user-defined scanner commands at profile resolution time and rejects those without an active Merge readinessKeep this PR open. It addresses a real scan-integrity problem, but the new comment detector does not match shell comment boundaries and can reject valid multiline scanner commands before they run. Priority: P2 Review scores
Verification
How this fits togetherProfile configuration turns user-defined scanner declarations into scanner adapters before a scan begins. This validation sits between YAML profile resolution and command execution, where a target path is passed to the scanner and its raw JSON output becomes run evidence. flowchart LR
A[Profile YAML] --> B[Custom scanner definition]
B --> C[Target placeholder validation]
C --> D[Scanner registry]
D --> E[Sandboxed scanner command]
E --> F[Raw JSON scan evidence]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Make placeholder classification follow shell comment boundaries—begin comments only where the shell would and end them at a newline—then add focused regression coverage for multiline commands and inline hashes. Do we have a high-confidence way to reproduce the issue? No direct runtime reproduction was executed in this read-only review, but source inspection gives a high-confidence path: a multiline command with a comment on one line and Is this the best way to solve the issue? No. Requiring an active target is the right safeguard, but the implementation should use shell-accurate comment boundaries rather than treating every later character after an unquoted Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5cfa90b129f4. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
What changes
A user-defined scanner
commandmust contain at least one active{{target}}placeholder — one that is not inside shell quotes and not after a#comment. A command with no active placeholder is rejected atconfig-resolution time.
Why it matters
The whole point of a scanner command is that ClawScan substitutes the target
path into it. If
{{target}}is missing (or only appears quoted/commented), thescanner runs against nothing — the run looks like it scanned the skill but the
tool never saw it, producing a false "clean". Failing loudly at config time
prevents a silently no-op scanner.
Before / after (runnable)
notarget.yml:A placeholder that is only inside quotes, or only after a
#, is likewiserejected; a normal
scan {{target}}is accepted.Verify