Repository navigation
fix(security): exempt emoji subdivision-flag tag sequences from unicode_steganography (#4135) - #4144
Merged
Merged
Conversation
…de_steganography (#4135) sec_unicode_steganography fired on the England/Scotland/Wales flags (U+1F3F4 + TAG letters + U+E007F CANCEL TAG), a benign run of six Tags-block codepoints. The rule now skips exactly one shape: a run that starts right after U+1F3F4, holds 3-7 lowercase-letter/digit tags, ends at U+E007F (optionally one VS16) and is followed by no further invisible codepoint. Tags with no flag base, uppercase/punctuation tags, overlong ids, a missing CANCEL TAG, or payload codepoints trailing a real flag still fire on the whole run. A leading negative lookbehind keeps matches anchored at a run's start so a skipped flag can't re-match mid-run. Fixes #4135 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
4 tasks done
Contributor
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.
Fixes #4135
What changed
sec_unicode_steganography("Invisible Unicode Payload Smuggling",gitgalaxy/security/security_lens.py) fired on emoji subdivision flags: England/Scotland/Wales are U+1F3F4 + TAG letters (gbeng/gbsct/gbwls) + U+E007F CANCEL TAG, a run of six Tags-block codepoints.The regex now skips exactly one shape: a run that
Everything else still fires on the whole run: tags with no flag base, uppercase or punctuation tags, an overlong id, a missing CANCEL TAG, or a payload trailing a real flag. A leading negative lookbehind keeps every match anchored at the start of a run, so a skipped flag can't match again from its second codepoint. The old greedy
{3,}withfinditernever matched mid-run either, so counts for every other input are unchanged. The signature's prefilter gate staysNone, as it was.Tests
tests/security_auditing/test_security_lens.py:usca) read 0.Verification
pytest tests/security_auditing tests/tools_recorders/test_record_keeper.py: 377 passedpytest tests/extraction/test_unicode_identifiers.py tests/core_engine/test_galaxyscope.py: 107 passedpython tests/tools/audit_check.py: all clear (ruff/format, mypy, dead-key, ast-accuracy)python tests/tools/crucible_check.py(both modes): PASS, no golden-master diff. That is expected. The pinned crucible isv1.6.0, which predates language-crucible#36, so no pinned file has a tag sequence. The 4 chore(deps): bump werkzeug from 3.1.5 to 3.1.8 #36 files score 0 under the new rule (old rule: 1 hit each, from 1-5 flag runs per file).Cross-repo
regexp-unicode-sets.js, excalidrawtextWrapping.ts, flutterInputConnectionAdaptorTest.java, symfonyemoji-ccp.php) as negative controls that must read 0. It changes only SOURCES.md text; nodata/file changes.docs/self_scan/BUMPING_THE_CRUCIBLE_PIN.md) re-blesses the golden masters. Invisible Unicode Payload Smuggling should read 0 on those 4 files, not 1.🤖 Generated with Claude Code