Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The identifier generator documented a guarantee it could not always keep.
realisticIdentifierbuilds camel, private-camel and pascal names from a hint, and callers derive that hint from customer identifiers such as$1,_0x1for_blaFoo. The hint sanitiser stripped non-word characters but deliberately kept underscores, so a customer name starting with_blacould come back as a__bla…decoy (and$00_AAAThingas a$...AAAname) — precisely the greppable substrings the anti-deblinding catalog keys on.assertNoForbiddenMarkersalready existed for this, was even imported by the AST shield, and was never actually called.What changed
realisticIdentifierinsrc/core/identifiers.tsnow strips the forbidden markers (_bla,$00_AAA) out of a customer-derived hint before it is composed into a name, so the emitted identifier can no longer carry one in from a customer variable.assertNoForbiddenMarkersbefore it leaves, so the documented guarantee is enforced and a future vocabulary change that reintroduces a marker fails closed instead of shipping.src/shields/javascript/ast-shield.tsis removed.tests/core-domain.test.tsgains a case that feeds_blaSecret,__blaHidden,$00_AAAThingand_bla_snakehints and asserts none of the emitted names leak a marker.Why this matters
The whole point of the realistic-identifier pass is that a hardened artifact carries no stable string a static de-blinding tool can key on. A customer identifier is attacker-adjacent input to that pass, so the guarantee has to hold for it too, not just for the built-in vocabulary.
Tests
npx vitest run tests/core-domain.test.ts tests/prng-derive.test.ts tests/class-rename-opaque-seed.test.ts tests/anti-deblind-decoy-scrub.test.ts tests/js-shield-cjs-named-exports.test.tspasses, 35 tests._blahint, which is how the leak was reproduced.Compatibility
Names built from the built-in vocabulary are unchanged, since those hints never contained a marker to strip. Only a hint that carried a marker changes, and it changes for the better.