Install scanner (tools/plugin_guard*, PLUGIN_SCANNER_VERSION bumped once):
- hardcoded_secret: a PostHog project key (phc_, write-only ingest key) joins the
Google installed-app secret as a public client key -> high (caution), only
when every matched literal on the line has a public prefix (telesec
telemetry.py:27 was dangerous). phx_ personal keys and any other token stay
critical.
- proc_access: reads of /proc/self|<pid>/{cgroup,mountinfo,stat,status,...}
(container placement, pid start time) land at low instead of high
(hermes-lcm-x cpu_capacity.py was caution). environ, cmdline, mem, maps, fd,
root/cwd, ns, bare /proc/self, any unlisted leaf and any write keep high.
Generalises #144304's cgroup/mountinfo allowance and keeps the finding
visible instead of dropping it.
- bytecode_file: a committed .pyc/.pyo (git ls-files; plus any bytecode outside
__pycache__) is a high structural finding, the binary_file tier (rule 17;
hermes-emotion shipped tests/__pycache__/*.pyc and scanned safe). Untracked
caches the validate run writes are not flagged.
Validator (hermes plugins validate, warnings only):
- private imports: gateway.session_context.get_session_env is the documented
route (plugins/index.md) and a plugin's fallback import of its own install
path (plugins.memory.openltm._db) is not a core import.
- new warning for private-method calls on core handles (SessionDB, AIAgent,
GatewayRunner, PluginContext) the plugin does not define itself
(opencode-sync db._execute_write, runner._evict_cached_agent).
- desktop surface review warning for raw window.hermesDesktop calls and app
markup selectors ([data-slot], [data-tree-*], [data-pane-host]) in CSS text
or closest() (squad-hub, novel-reader, search-sources).
A catalog plugin that queries or creates a `<webview>` scripts the preview
page without declaring `preview.executeJavaScript` or asking the user.
Admission now fails it as "preview guest reach"; `ctx.preview` stays clean.
The rule could not tell a bundled library's own classes from patching a renderer global: it kept
failing legitimate bundles (three.js once minified to $-names) and still missed a bare $ receiver.
Prototype writes in a Desktop plugin are now read by the catalog reviewer instead; the policy in the
catalog docs stays, with a note that review checks it by hand. eval/new Function, non-SDK imports,
script injection and app-DOM reach are still linted.
An expression must follow return/typeof/throw/etc., so a `/` there can only
open a regex; offering the division reading left the regex text visible and
refused `return /Track = vector/` as a rebinding of Track. `of` keeps both
readings because it is also a plain identifier.
- After `)` or `}` a `/` can open a regex or be division; picking either
one lets a crafted literal hide code (a quote inside `if (x) /"/` blanked
the patch after it). The scanner now follows every legal reading at once
and blanks a character only when ALL live readings agree it is literal
text. The true reading is always among them, so executable code is never
blanked; a regex after `if (...)` is also read correctly again.
- In a destructuring pattern, a class name used only as a key
(`{Track: value} = o`) is not a rebinding of Track.
- A destructuring assignment after `?`, `:`, `&&`, `||`, `!`, return, yield
or void now counts as rebinding X (`c ? [S] = [window.Storage] : 0`).
- Drop the if-condition regex heuristic: it scanned raw text backwards, so
`Number("if (") / (Storage.prototype.x = spy) / 3` read as a regex and the
patch between the slashes was blanked. Every ambiguity now resolves toward
scanning as code: a wrong guess there only refuses a bundle for review,
while a wrong guess the other way hides a patch.
- `registry[Track.name] = Track` read as a destructuring pattern naming Track.
A pattern now has to open where an expression cannot (start of statement,
after = ( , or let/const/var) and name X itself, not X.name.
- The scanner read any `/` after `)` as division, so a regex statement after
`if (ready)` was scanned as code. A `)` that closes an if/while/for/with
condition now lets a regex literal start.
- A destructuring ASSIGNMENT (`({S} = o)`, `[S] = a`), compound assignment
(`S ||= x`), `for (S of ...)` and import bindings now count as rebinding S.
- The literal mask blanked whole template literals (hiding code in `${...}`)
and treated `/ (...) /` division as a regex (hiding the code between). It
is now a small scanner: string and template TEXT is blanked, `${...}` stays
code, and `/` opens a regex only where an expression cannot end before it.
The rebinding check read any `(X)` or `, X)` as a binding, so
`register(Track); Track.prototype.x = ...` failed admission, and it scanned
unmasked source, so a label like "Track = vector" did too. A rebinding is now
only an assignment, a let/const/var/class/function declaration, a destructuring
declaration, or a parameter (function, method, arrow, catch), matched on source
with strings and regex literals masked.
Greptile (3/5) held the PR because aliases could still borrow an unrelated
class name: the alias list enumerated spellings, and window["Storage"] or
(0, window.Storage) were not on it. Enumerating spellings cannot be finished,
so the rule flips: X.prototype.y = passes only inside the body of class X /
function X, or after a class X / function X / var X = class statement in the
same block, with no rebinding of X in between. Everything else fails,
whatever the alias looks like. This also holds for minified bundles that reuse
one-letter names (three.js minified: class s{...s.prototype.isVector2=!0}).
three.module.js, three.core.js and the minified Meshy bundle: 0 findings.
The alias rule treated any `{ Array: Track }` object literal as destructuring
from a renderer global, so a bundled library keeping a type registry was refused
for writing its own Track.prototype. Destructuring now counts only when the
source is window/globalThis/self.
The declared-name set is file-wide, so `function u() { class S {} }` excused
`const S = window.Storage; S.prototype.setItem = ...` (Greptile review). Any name
bound to a renderer global (`X = Storage`, `X = window.Storage`,
`{ Storage: X } = window`) now always fails, like the global itself. The three.js
bundles still pass.
The "prototype patching" admission rule matched any `X.prototype.y =` line. A
bundled library setting fields on classes it declares itself trips it: three.js
alone hits it 29 times (`var Vector2 = class _Vector2 { constructor() {
_Vector2.prototype.isVector2 = true } }`, `KeyframeTrack.prototype.ValueTypeName
= ...`), so no Desktop plugin could ship a three.js viewer.
The write now fails only when the receiver is not a class/function the file
declares, or is a renderer/browser global (Storage, HTMLElement, Array, ...),
which keeps failing even when the file shadows it with a same-named class (a
regex cannot see scope). Every attack shape the rule exists for still fails:
`Storage.prototype.setItem = ...`, an alias of a global, a shadowed global.
The admission lint only scanned desktop/**/*.js, but the Desktop git installer (findDesktopEntry) prefers a repo-root plugin.js and publishes the root beside it, so root-layout plugins skipped the lint entirely.
Catalog policy (Teknium): a listed plugin extends Hermes only through public
surfaces. A plugin that replaces core functions, methods or Desktop UI in place
collides with every other plugin patching the same seam and breaks on any core
release.
- New `no core override` admission check (hermes_cli/plugin_validate_core_override.py):
static taint pass over the import closure of __init__.py and dashboard/*.py.
Core values are Hermes modules (plus hermes_plugins.*) and attribute chains off
them, reached by import, importlib/sys.modules lookups, getattr, iteration, or a
plugin helper that returns one. Rebinds are attribute assignment/deletion,
setattr/delattr, sys.modules writes, writes into a core module's tables,
mock.patch, and passing a core value to a helper that setattr's its parameter.
Tests, benchmarks and CI/smoke scripts outside the import closure are not judged.
- Desktop lint: new `app DOM reach` rule (document-level queries of the app's own
data-slot/data-tour/data-sidebar/data-testid markup, and document.body
childList/subtree MutationObservers).
- Desktop lint bug: the comment stripper did not skip string literals, so a string
holding `/*` (a glob like '**/*.md') opened a fake comment and hid every line up
to the next `*/` from all rules. Strings are now matched first and kept.
- README rule 9, the plugin-catalog user guide and the plugin developer guide's
compatibility contract state the rule.
A/B over 466 pinned trees (121 open catalog PR entries + 349 listed entries +
humalike): the new checks flag exactly the hand-verified overrides; zero crashes;
no previously reported Desktop finding disappears.
Review finding (MAJOR-1): masking the first argument of every new RegExp(...)
also hid `el.innerHTML = new RegExp("<script src=x></script>").source`, a real
injection through .source — desktop_surface_findings returned 0 findings for
that line. The literal is now masked only when the constructor is the argument
of .replace/.replaceAll/.split/.match/.matchAll/.search or the receiver of
.test/.exec; every other use (.source, .toString(), template interpolation) is
a string-builder and keeps firing. The existing test gains the .source line
(must flag) and a .test() line (must not).
The regex-literal form was already masked (50e9cd7bd5); rss-reader
(#115972, desktop/plugin.js:2577) still ships "<scr"+"ipt" split strings
because the same sanitiser spelled for a dynamic flag — the string handed
straight to new RegExp( — kept scoring as 'script injection'. Mask only
that first-argument literal; a '<script' string written into the DOM and
createElement('script') + .src= still fail.
Part of #116305 (item 10).
The 'dynamic import outside the SDK' rule matched only import(); a static import 'https://…' passed admission while being the same one-line second stage. New rule 'remote import outside the SDK' mirrors the loader's allowlist so review and the app agree.
Branch semantics kept where main and PM disagree: update_cmd_deps.py,
constraints-termux.txt, the Electron update-api-check module and the
post-swap hand-off test stay deleted; the pending-fleet-restart catch-up
and the local_runtime tag/download ladder stay retired (PM owns engines).
Ported from main onto the branch's shape: profile_scoped_chore for the
auto-archive and plugin-update housekeeping chores, the local-runtime
cross-process boot lock and residency cap, the checkpoint tmp_pack sweep,
the cua daemon-liveness status probe, the remote-served Desktop update
flag (posix.sh / windows.ps1), sign-in for env-pinned remote gateways
(urlDisabled on RemoteSetupFields), the uvloop extra split (uvicorn
without [standard]), and the umask-scoping spawn test.
uv.lock regenerated with pm.build_env --lock-only; new utf-8 reads from
main switched to utf-8-sig (check-windows-footguns).
Real catalog pins from the 2026-09-20 intake batch scored on text that cannot run on
the installing host:
1. `.github/workflows/*.yml` — a CI step's own `os.environ['RUNNER_TEMP']` read scored
`python_os_environ/high` and made a clean plugin `caution` (remarkable). A workflow
runs on the forge's runner; it now takes the README prose cap (one step down,
agent-facing shapes like `curl | sh` keep full severity).
2. "pip install" inside a user-facing message literal (`"... no pip install is needed"`,
image-utils) scored `unpinned_pip_install/medium`; mid-literal, non-command position,
no exec verb on the line → low. `"pip install x"`, `python -m pip install`, `uv pip`,
`subprocess.run("pip install …")` keep medium.
3. `desktop_surface_findings()` was being run by batch tooling over every `*.js`/`*.mjs`
in a repo and flagged a Node sidecar's lazy `import('jszip')` (remarkable). The
product check was already scoped to `desktop/`; expose that scope as
`is_desktop_surface()` / `desktop_surface_hits()` so tooling shares it.
4. `127.0.0.1:<port>` (README, .mcp.json, client defaults) scored `hardcoded_ip_port` as
network egress; a line whose every IP:port is loopback → low. A routable address on
the line keeps medium.
Every finding stays in the report. PLUGIN_SCANNER_VERSION → plugin-guard-v8 so cached
verdicts on quarantined pins are re-evaluated.
Desktop lint: /<script[\s\S]*?<\/script>/gi in a feed sanitiser scored as
'script injection' and failed pinned-source-validate for rss-reader. Mask
JS regex literals for the markup-shaped rule only; <script in a string
literal (an innerHTML payload) and createElement('script') still fail.
Install scanner: "printenv" as a whole-string entry of a read-only
allowlist (frozenset({..., "printenv"})) fired dump_all_env high →
caution on hermes-jev. Extend the literal-token demotion: a token that is
the ENTIRE quoted literal on a line that executes nothing steps down like
an alternation member; "sudo" inside subprocess.run([...]) and
os.system("printenv") keep high.
A/B vs origin/main: attack probes identical (23 rows), in-tree sweep 319
entries 0 worse/0 changed; both new tests red on base. Bumps
PLUGIN_SCANNER_VERSION to v6 so cached caution verdicts refresh.
Signed-off-by: teknium1 <teknium1@users.noreply.github.com>
A desktop/plugin.js is evaluated in the Electron renderer with the app's
full authority; the runtime loader documents itself as error isolation
only and says a remote source must not reuse it without a boundary. The
catalog is that remote source, so admission now fails a plugin whose
desktop code patches prototypes, uses eval/new Function, dynamically
imports anything but the SDK (app chunks, blob/http URLs), or injects
script tags. Against the 18 desktop plugins in the current sweep the lint
passes 17 and fails the one the security review flagged for exactly these
moves. Policy written down in plugin-catalog/README.md rule 8 and the
user-facing catalog doc.