-
-
Notifications
You must be signed in to change notification settings - Fork 16
Reject unescaped control bytes in JSON strings #539
Copy link
Copy link
Open
Labels
bugA problem that causes incorrect behavior or crashes.A problem that causes incorrect behavior or crashes.good first issueIssues that are good for newcomers or first-time contributors.Issues that are good for newcomers or first-time contributors.
Description
Activity
Metadata
Metadata
Assignees
Labels
bugA problem that causes incorrect behavior or crashes.A problem that causes incorrect behavior or crashes.good first issueIssues that are good for newcomers or first-time contributors.Issues that are good for newcomers or first-time contributors.
The JSON string parser handles escapes and closing quotes, then appends every other byte through the default branch. Raw bytes U+0000 through U+001F are therefore accepted inside quoted strings, including literal newlines and tabs. These bytes must be escaped in JSON. This is separate from the UTF-8 and Unicode-escape decoding work in #351.
Source evidence at the head of #520:
fn parse_stringAcceptance:
API/reference context: JSON string character restrictions, section 7.
Related: #351.
Audit status: identified by static source inspection; the scenarios above have not been executed during this audit. The permalink fixes the reviewed revision; this report does not claim the defect was introduced by #520.