Repository navigation
fix(security): handle additional Unicode angle bracket homoglyphs in content sanitization - #14665
Merged
steipete merged 2 commits intoFeb 13, 2026
Merged
Conversation
…content sanitization The foldMarkerChar function sanitizes external content markers to prevent prompt injection boundary escapes, but only handles fullwidth ASCII (U+FF21-FF5A) and fullwidth angle brackets (U+FF1C/FF1E). Add handling for additional visually similar Unicode characters that could be used to craft fake end markers: - Mathematical angle brackets (U+27E8, U+27E9) - CJK angle brackets (U+3008, U+3009) - Left/right-pointing angle brackets (U+2329, U+232A) - Single angle quotation marks (U+2039, U+203A) - Small less-than/greater-than signs (U+FE64, U+FE65)
Contributor
Author
|
@cpojer Could you help review this PR? Thanks! |
skyhawk14
pushed a commit
to skyhawk14/openclaw
that referenced
this pull request
Feb 13, 2026
…content sanitization (openclaw#14665) * fix(security): handle additional Unicode angle bracket homoglyphs in content sanitization The foldMarkerChar function sanitizes external content markers to prevent prompt injection boundary escapes, but only handles fullwidth ASCII (U+FF21-FF5A) and fullwidth angle brackets (U+FF1C/FF1E). Add handling for additional visually similar Unicode characters that could be used to craft fake end markers: - Mathematical angle brackets (U+27E8, U+27E9) - CJK angle brackets (U+3008, U+3009) - Left/right-pointing angle brackets (U+2329, U+232A) - Single angle quotation marks (U+2039, U+203A) - Small less-than/greater-than signs (U+FE64, U+FE65) * test(security): add homoglyph marker coverage --------- Co-authored-by: Peter Steinberger <[email protected]>
GwonHyeok
pushed a commit
to learners-superpumped/openclaw
that referenced
this pull request
Feb 15, 2026
…content sanitization (openclaw#14665) * fix(security): handle additional Unicode angle bracket homoglyphs in content sanitization The foldMarkerChar function sanitizes external content markers to prevent prompt injection boundary escapes, but only handles fullwidth ASCII (U+FF21-FF5A) and fullwidth angle brackets (U+FF1C/FF1E). Add handling for additional visually similar Unicode characters that could be used to craft fake end markers: - Mathematical angle brackets (U+27E8, U+27E9) - CJK angle brackets (U+3008, U+3009) - Left/right-pointing angle brackets (U+2329, U+232A) - Single angle quotation marks (U+2039, U+203A) - Small less-than/greater-than signs (U+FE64, U+FE65) * test(security): add homoglyph marker coverage --------- Co-authored-by: Peter Steinberger <[email protected]>
lovewanwan
pushed a commit
to lovewanwan/openclaw
that referenced
this pull request
Apr 28, 2026
…content sanitization (openclaw#14665) * fix(security): handle additional Unicode angle bracket homoglyphs in content sanitization The foldMarkerChar function sanitizes external content markers to prevent prompt injection boundary escapes, but only handles fullwidth ASCII (U+FF21-FF5A) and fullwidth angle brackets (U+FF1C/FF1E). Add handling for additional visually similar Unicode characters that could be used to craft fake end markers: - Mathematical angle brackets (U+27E8, U+27E9) - CJK angle brackets (U+3008, U+3009) - Left/right-pointing angle brackets (U+2329, U+232A) - Single angle quotation marks (U+2039, U+203A) - Small less-than/greater-than signs (U+FE64, U+FE65) * test(security): add homoglyph marker coverage --------- Co-authored-by: Peter Steinberger <[email protected]>
ogt-redknie
pushed a commit
to ogt-redknie/OPENX
that referenced
this pull request
May 2, 2026
…content sanitization (openclaw#14665) * fix(security): handle additional Unicode angle bracket homoglyphs in content sanitization The foldMarkerChar function sanitizes external content markers to prevent prompt injection boundary escapes, but only handles fullwidth ASCII (U+FF21-FF5A) and fullwidth angle brackets (U+FF1C/FF1E). Add handling for additional visually similar Unicode characters that could be used to craft fake end markers: - Mathematical angle brackets (U+27E8, U+27E9) - CJK angle brackets (U+3008, U+3009) - Left/right-pointing angle brackets (U+2329, U+232A) - Single angle quotation marks (U+2039, U+203A) - Small less-than/greater-than signs (U+FE64, U+FE65) * test(security): add homoglyph marker coverage --------- Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
May 9, 2026
…content sanitization (openclaw#14665) * fix(security): handle additional Unicode angle bracket homoglyphs in content sanitization The foldMarkerChar function sanitizes external content markers to prevent prompt injection boundary escapes, but only handles fullwidth ASCII (U+FF21-FF5A) and fullwidth angle brackets (U+FF1C/FF1E). Add handling for additional visually similar Unicode characters that could be used to craft fake end markers: - Mathematical angle brackets (U+27E8, U+27E9) - CJK angle brackets (U+3008, U+3009) - Left/right-pointing angle brackets (U+2329, U+232A) - Single angle quotation marks (U+2039, U+203A) - Small less-than/greater-than signs (U+FE64, U+FE65) * test(security): add homoglyph marker coverage --------- Co-authored-by: Peter Steinberger <[email protected]>
lhfer
pushed a commit
to lhfer/openclaw
that referenced
this pull request
Oct 11, 2026
…content sanitization (openclaw#14665) * fix(security): handle additional Unicode angle bracket homoglyphs in content sanitization The foldMarkerChar function sanitizes external content markers to prevent prompt injection boundary escapes, but only handles fullwidth ASCII (U+FF21-FF5A) and fullwidth angle brackets (U+FF1C/FF1E). Add handling for additional visually similar Unicode characters that could be used to craft fake end markers: - Mathematical angle brackets (U+27E8, U+27E9) - CJK angle brackets (U+3008, U+3009) - Left/right-pointing angle brackets (U+2329, U+232A) - Single angle quotation marks (U+2039, U+203A) - Small less-than/greater-than signs (U+FE64, U+FE65) * test(security): add homoglyph marker coverage --------- Co-authored-by: Peter Steinberger <[email protected]>
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.
Summary
Fix
Add folding for additional Unicode angle bracket homoglyphs:
Also remove now-unused standalone constants in favor of the lookup map.
Test plan
Greptile Overview
Greptile Summary
This change expands
foldMarkerChar()/foldMarkerText()insrc/security/external-content.tsto normalize additional Unicode “angle bracket” homoglyphs (e.g., U+2329/U+232A, U+2039/U+203A, U+27E8/U+27E9, U+3008/U+3009, U+FE64/U+FE65) into ASCII</>.That normalization feeds into
replaceMarkers(), which looks for external-content boundary markers like<<<EXTERNAL_UNTRUSTED_CONTENT>>>after folding. By covering more lookalike bracket characters, the wrapper is harder to bypass with visually similar Unicode when trying to spoof/escape the trusted boundary markers.Confidence Score: 5/5