Repository navigation
core: HTML entity decoding (TASKS 1.5) - #22
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ig_html_decode(): numeric references (decimal/hex, ';' optional, invalid code points -> U+FFFD) and an attack-relevant subset of HTML5 names, with legacy names also accepted without ';'. One pass, never longer than the input, in place allowed. Decoding reveals javascript: and java	script: to ig_detect_xss. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
TASKS 1.5 (FR-1.3). Design note: PRD section 13, "1.5".
ig_html_decode(in, len, out)insrc/core/ig_normalize: one pass of HTML5 character reference decoding.&#N/&#xH,;optional, leading zeros;0, surrogates and values above10FFFFbecome U+FFFD (no NUL appears).lt gt amp quot nbspalso without;;colon lpar rpar Tab NewLine grave …with;), case-sensitive, exposed viaig_html_entities().ig_put_utf8now writes 4-byte sequences.tests/unit/test_html_decode.c(10 cases, includingjavascript:andjava	script:…reachingig_detect_xssas ATTACK), fuzz targetfuzz_html_decodewith seeds.Local: unit (gcc, clang ASan/UBSan, CentOS 7), clang-tidy, clang-format, cppcheck, phpt on 7.0 NTS and 8.5 ZTS, fuzz 30 s per target, license check.
Wiring into the inspection pipeline (URL normalization → HTML decoding → XSS) comes with phases 2/4.
🤖 Generated with Claude Code