Skip to content

fix(security): expose every executable call in plugin scans - #116222

Merged
vincentkoc merged 2 commits into
mainfrom
audit/scanner-all-findings
Jul 30, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
audit/scanner-all-findings

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Jul 30, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where plugin package security scans could omit later executable calls after finding the first matching call in a file. That made reviewed scan output incomplete when one generated or source file contained multiple process-execution sites.

Why This Change Was Made

The line-rule scanner now reports distinct matches in source order, capped at 32 findings per rule and file. Dense input is still scanned to EOF; overflow becomes a same-severity aggregate finding with the omitted count and final affected line, so output stays bounded without silent omission. Existing context checks, benign member-call filtering, standard-port filtering, bounded evidence, and deterministic order remain intact.

Provenance: the first-match cap was introduced in #9806, merged February 6, 2026. Later scanner work carried that behavior forward.

User Impact

Operators and reviewers now see each normal-volume executable call in plugin security scan output. Dense hostile input produces bounded findings plus explicit aggregate overflow evidence. Runtime plugin behavior is unchanged.

Evidence

  • node scripts/run-vitest.mjs src/skills/security/scanner.test.ts: 36/36 passed
  • Dense-input regression proves 32 retained findings plus an aggregate for 8 omitted matches through the final affected line
  • Direct Codex package scan after a clean build: 8 critical findings instead of 7, exposing both distinct run-attempt execution sites
  • git diff --check: clean
  • Autoreview: clean, 0.96 confidence, no actionable findings
  • Local src/plugins/npm-install-security-scan.release.test.ts could not start because npm 11 returned the separate package-name-keyed npm pack --dry-run --json shape; exact PR CI is the authoritative broader gate

@vincentkoc vincentkoc self-assigned this Jul 30, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Jul 30, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review July 30, 2026 04:17
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jul 30, 2026
@clawsweeper

clawsweeper Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 30, 2026, 12:36 AM ET / 04:36 UTC.

ClawSweeper review

What this changes

The PR changes plugin package security scanning to report repeated executable-call matches in source order, while summarizing matches beyond a fixed per-rule, per-file limit.

Merge readiness

✅ Ready for maintainer review

The prior blocking concern is addressed: the revised patch retains a deterministic 32-findings-per-rule-per-file bound and adds an explicit overflow finding, while the prior changelog concern is absent from the current two-file diff. Keep this maintainer-authored, protected-label PR open for normal merge review rather than auto-cleanup.

Priority: P1
Reviewed head: c4eb4d52000a8bd05e8fcadfcc2f7018d59ce976

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The revised patch directly resolves the prior boundedness finding with focused regression coverage and no remaining discrete correctness defect evident in the supplied revision.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a maintainer-member PR, so the external-contributor proof gate does not apply; the PR body nevertheless provides focused test results and a direct package-scan observation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-member PR, so the external-contributor proof gate does not apply; the PR body nevertheless provides focused test results and a direct package-scan observation.
Evidence reviewed 4 items Prior blocker addressed: The current PR head adds MAX_LINE_RULE_FINDINGS_PER_RULE = 32, counts omitted matches, and emits one aggregate truncation finding; this directly addresses the previous review's concern that reporting every regex match could retain unbounded findings from a package-controlled source file.
Regression coverage: The revised tests cover multiple executable calls on separate and shared lines plus 40 dense matches, expecting 32 retained findings and an eighth-match overflow summary at the final affected line.
Review continuity: The previous completed ClawSweeper cycle requested a deterministic per-file/per-rule cap and explicit aggregation; the second PR commit is specifically titled fix(security): bound scanner match evidence, and the current diff implements that requested shape.
Findings None None.
Security None None.

How this fits together

OpenClaw scans plugin and skill package source during installation and deep security audits, producing findings that help operators assess code before it runs. This PR changes the line-rule collection stage that turns repeated suspicious source matches into install warnings and audit output.

flowchart LR
  Package[Plugin package source] --> Scanner[Security scanner]
  Scanner --> Rules[Line-level security rules]
  Rules --> Cap[Per-rule finding cap]
  Cap --> Findings[Findings and overflow summary]
  Findings --> Install[Install warning]
  Findings --> Audit[Deep security audit]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +19, Tests +37. Total +56 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 42 23 +19
Tests 1 37 0 +37
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 79 23 +56

Review metrics

None.

Technical review

Best possible solution:

Merge the bounded repeated-match implementation after normal maintainer review and completion of the current required checks, preserving the aggregate overflow evidence as the scanner's package-input safety boundary.

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

Yes, at source level: the former first-match behavior can be exercised with multiple spawn or execFile calls in one source file, and the PR adds focused coverage for that case. This read-only review did not independently run the test.

Is this the best way to solve the issue?

Yes. Reporting distinct accepted matches while retaining a fixed per-rule/per-file cap and an overflow summary is a narrower, safer fix than either silently stopping at the first match or emitting unbounded package-controlled findings.

AGENTS.md: unclear because the file could not be read completely.

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

Labels

Label justifications:

  • P1: The repaired scanner path can otherwise omit executable-call evidence that operators rely on when evaluating plugin packages.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a maintainer-member PR, so the external-contributor proof gate does not apply; the PR body nevertheless provides focused test results and a direct package-scan observation.

Evidence

What I checked:

  • Prior blocker addressed: The current PR head adds MAX_LINE_RULE_FINDINGS_PER_RULE = 32, counts omitted matches, and emits one aggregate truncation finding; this directly addresses the previous review's concern that reporting every regex match could retain unbounded findings from a package-controlled source file. (src/skills/security/scanner.ts:62, c4eb4d52000a)
  • Regression coverage: The revised tests cover multiple executable calls on separate and shared lines plus 40 dense matches, expecting 32 retained findings and an eighth-match overflow summary at the final affected line. (src/skills/security/scanner.test.ts:152, c4eb4d52000a)
  • Review continuity: The previous completed ClawSweeper cycle requested a deterministic per-file/per-rule cap and explicit aggregation; the second PR commit is specifically titled fix(security): bound scanner match evidence, and the current diff implements that requested shape. (src/skills/security/scanner.ts:393, c4eb4d52000a)
  • Original behavior provenance: The linked merged scanner introduction explicitly documented “one finding per rule per file” as an intentional noise bound; this PR narrows that prior behavior by preserving a bound while exposing normal-volume repeated execution sites. (src/security/skill-scanner.ts, bc88e58fcfa0)

Likely related people:

  • thebenignhacker: The merged scanner introduction documented the one-finding-per-rule-per-file bound that this repair revises. (role: introduced the original scanner behavior; confidence: medium; commits: f088d456b373, bc88e58fcfa0; files: src/security/skill-scanner.ts)
  • vincentkoc: The current PR's two commits implement the bounded repeated-match collection and its focused regression coverage. (role: recent area contributor; confidence: high; commits: 3ed4bd6bea40, c4eb4d52000a; files: src/skills/security/scanner.ts, src/skills/security/scanner.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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-07-30T04:21:52.017Z sha 3ed4bd6 :: found issues before merge. :: [P1] Keep plugin-scan findings bounded | [P3] Remove the release-owned changelog entry

@clawsweeper clawsweeper Bot added 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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jul 30, 2026
@vincentkoc
vincentkoc merged commit 2899323 into main Jul 30, 2026
130 of 140 checks passed
@vincentkoc
vincentkoc deleted the audit/scanner-all-findings branch July 30, 2026 04:45
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
…#116222)

* fix(security): report every scanner line match

* fix(security): bound scanner match evidence
vincentkoc added a commit to Hackerismydream/openclaw that referenced this pull request Jul 30, 2026
* origin/main: (24 commits)
  fix(e2e): apply default service identity per flow (openclaw#116265)
  chore(android): record 2026.7.4 Play metadata
  fix(ci): accept one verified Telegram SUT launch (openclaw#116267)
  chore(android): prepare 2026.7.4 Play release
  fix(e2e): align service account state (openclaw#116254)
  refactor(qa): remove live-channel scenario registries and wrappers (openclaw#115752)
  fix(ci): let trusted Telegram QA stage runtime (openclaw#116252)
  fix(plugins): plugin install survives pnpm-only overrides (openclaw#116245)
  test(qa): recognize internal image completions (openclaw#116234)
  fix(test): review Codex runtime scan chunks (openclaw#116212)
  fix(systemd): clear start-limit latch before gateway start (openclaw#116178)
  fix(security): expose every executable call in plugin scans (openclaw#116222)
  chore(sdk): repin the API baseline after the resolver signature change
  test(e2e): delay the draft-proof final answer past the start gate
  fix(channels): resolve tool progress against the caller's stream mode
  fix(ci): satisfy docs formatting, lint, and the SDK API baseline
  test(e2e): add a progress-draft scenario to the mock provider
  docs(telegram): call out the changed default preview on upgrade
  refactor(channels): render the progress label as a block, not a line
  fix(channels): show tool lines under the progress status headline
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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