Skip to content

Commit

Permalink
grammars : blacklists character control set (#5888)
Browse files Browse the repository at this point in the history
* Prevent control characters from being served in json string

* Prevent control characters from being served in json string (array)
  • Loading branch information
ExtReMLapin authored Mar 5, 2024
1 parent 82cb31e commit 3de3167
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion grammars/json.gbnf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ array ::=

string ::=
"\"" (
[^"\\] |
[^"\\\x7F\x00-\x1F] |
"\\" (["\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]) # escapes
)* "\"" ws

Expand Down
2 changes: 1 addition & 1 deletion grammars/json_arr.gbnf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ array ::=

string ::=
"\"" (
[^"\\] |
[^"\\\x7F\x00-\x1F] |
"\\" (["\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]) # escapes
)* "\"" ws

Expand Down

0 comments on commit 3de3167

Please sign in to comment.