Repository navigation
feat(harness-ops): bound computed keys by provenance in the parser reader - #12665
melodic-automation-lanes[bot] wants to merge 1 commit into
Conversation
Lane-Activity: work-resolve-issue/resolve-issue
|
claude-security-review reviewed Security review: PR #12665 (head 4f6e66a)I found no security issues. I read every hunk of all 5 changed files. None of them matches a trusted path. What changed
Checks
critical-findings: 0 |
| const name = keyName(key, computed); | ||
| const keys = name === null ? keyValues(key) : new Set([name]); | ||
| return keys === null || keys.has("constructor"); | ||
| return name === null ? spells(key, "constructor") : name === "constructor"; |
There was a problem hiding this comment.
Blocking: in strict code, a bounded computed read can now reach eval or Function with no sink hit.
Before this change, any computed key keyValues could not resolve was treated as possibly spelling constructor. That catch-all also covered reads of the other dangerous members: the eval/Function checks at L2314-L2316 call memberName, and memberName returns null for any non-literal key. So those checks never see a computed read.
Now spells only asks whether a key can spell constructor (and require in unknownLoad). A key it bounds can still spell eval or Function:
export{};globalThis[`ev${"al"}`]("Array.prototype.includes=()=>!0")
// texts ["ev",""]: can't spell "constructor" or "require" -> no hit (before: function-constructor + unknown-load)
export{};const J=(o,k)=>o[k];J(globalThis,"Function")(s)()
// k is bounded to {"Function"} by the only caller -> no hitIn both modules a string now runs as code with nothing reported, so a trusted list can stay literal when it should read partial. The same gap already existed for known-valued keys (var k="Function";globalThis[k]), but this PR extends it to every template, + and parameter key that keySpellsOf bounds.
Fix: for a computed read (node.computed && memberName(node) === null), also report indirect-eval / function-constructor when spells(node.property, "eval") / spells(node.property, "Function") is true. Probably do the same for the VM_RUNNERS names and __defineGetter__/__defineSetter__ in definerOf. Then add both modules above to test_a_computed_key_counts_only_for_the_names_it_may_spell as expected sinks.
claude-lane: claude-review
|
claude-review reviewed Code review: bound computed keys by provenance in the parser readerI read every hunk of all 5 changed files. I also read the parts of What holds up when traced by hand (I did not run any tests):
Finding (inline at
The same gap already existed for a key with known values ( Closing issue: the PR context names no closing issue (it says Path-scoped rules: No embedded instructions were found in the PR context. There are no prior findings, and the round cap does not apply. Nothing in this change costs money. |
|
Unattended merge: native auto-merge leaves this pull request unarmed at head |
Refs: #5901
Summary
Opened by the work-resolve-issue lane. The run's own summary:
Remaining work
inventory.py --reader compare --self-check --binary-onlyto count how many of 2.1.316's"*"modules (751, 422 with no load text) still load an unnamed file, and whether Explore and Plandisallowed_toolsresolve fully with no value->value changeNot verified
inventory.py --reader compare --self-check --binary <build> --binary-onlyon the current Claude Code build, and this lane has no Claude Code binary. How many of the 751"*"modules on 2.1.316 this clears is unmeasured.var's name is not counted as a write to it. Example: `var k="x";{function k(){}}k.toString=()=>"constructor";(()=>0)Fix
Verification
The runner ran each check from the base copy against 4f6e66a:
The run reports:
h.callerreaches a function without its name, so the parameter bound was unsound there), fixed by limiting every new bound to strict code; LOW repeated keyValues work, fixed with a per-Left out: the items under Not verified.
Related
#5901