Skip to content

fix: count any value from another input as foreign unless proven local - #465

Merged
Sorte1 merged 2 commits into
mainfrom
fix/r51-ml8
Nov 20, 2026
Merged

Sorte1 merged 2 commits into
mainfrom
fix/r51-ml8

Conversation

@Sorte1

@Sorte1 Sorte1 commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Fixes finding 1 (CRITICAL) and finding 3 (LOW) of review/r6-ml7.md.

With several inputs, a function that another input hands out (for example (function () {})[k] with k = "constructor") was only caught when it was called directly. Any other route, such as [f()][0](text), (0, f())(text), new (f())(text), a second alias, a pattern, a parameter, for-of, catch, an object field, await or .then(f()), let it overwrite the decoder while untwist still inlined the decoded strings.

The check is now an allow-list. If an input names another input's global, then every call, new and tagged template in it counts as a possible code runner unless its callee is proven local: literals, this input's own functions and what they return, plain literal holders, or built-in chains. A value that isn't proven local, passed to a callee that isn't one of this input's functions, counts the same way. Inputs that never name another input's globals are judged as before, and single-input runs are unchanged.

The kept-machinery note now says which built-in verdict it comes from (write, hand on, or not judged).

Gates:

  • Crate tests and a full untwist-ci pass. One firefox e2e test failed once and passed on rerun.
  • r6-ml7 probe sets: n5 goes from 90 differing rows to 0. Across the other 27 sets, the only default-lane differences left are finding 2 (n4 6, n6 60) and the printer-premise s/sN rows, the same rows the reviewer reported. A few rows that decoded correctly before are now kept.
  • Full sweep: 3465 cases, identical to main in both lanes.
  • Krunker: byte-identical in both lanes.
  • BASELINEs: obfuscator-io, obfuscator-relayer and obfuscator-versions have 0 failed and 0 unexpected-pass.
  • wasm: 16,436,902 bytes, so the baseline is raised to 14,943,000.

With another input given and this input naming one of its globals, a call,
new or tagged template now counts as a possible code runner unless its
callee is proven local by an allow-list (literals, this input's functions
and their returns, plain literal holders, built-in chains). A non-local
value handed to a callee that is not this input's function counts the same.
The kept-machinery note names the built-in verdict it comes from.

This branch was successfully deployed

1 active deployment
preview — 0c3bea90 Deployed Nov 20, 2026 by Sorte1 via deploy #1351
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