Skip to content

escape raw quotes after an escaped backslash in escapeJson#3167

Merged
coheigea merged 1 commit into
apache:mainfrom
dxbjavid:escapejson-escaped-backslash
Jun 3, 2026
Merged

escape raw quotes after an escaped backslash in escapeJson#3167
coheigea merged 1 commit into
apache:mainfrom
dxbjavid:escapejson-escaped-backslash

Conversation

@dxbjavid
Copy link
Copy Markdown
Contributor

@dxbjavid dxbjavid commented Jun 2, 2026

Found while fuzzing toJson/fromJson round-trips. escapeJson looked only at the single char before a " or \ to decide it was already escaped, so a value holding a complete escaped-backslash pair (\) followed by a quote left that quote raw and broke out of its JSON string, letting a string value inject sibling members. Consume a backslash together with the char it escapes in one pass, so any leftover raw quote or backslash is always escaped while existing sequences are kept. Same single-char-lookback flaw as the reader fix in #3140.

@reta reta requested a review from coheigea June 2, 2026 12:35
@coheigea coheigea merged commit fd8674c into apache:main Jun 3, 2026
5 checks passed
coheigea pushed a commit that referenced this pull request Jun 3, 2026
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.

2 participants