error upon encountering escaped u+0000 to prevent malicious json
This commit is contained in:
parent
ed71ce7b7f
commit
0507dc38dc
1 changed files with 4 additions and 0 deletions
|
@ -468,6 +468,10 @@ escaped_unicode(<<D/?utfx, Rest/binary>>, Stack, Opts, String, [C, B, A])
|
|||
%% non-characters, you're not allowed to exchange these
|
||||
; X when X == 16#fffe; X == 16#ffff ->
|
||||
{error, {badjson, <<D/?utfx, Rest/binary>>}}
|
||||
%% allowing interchange of null bytes allows attackers to forge
|
||||
%% malicious streams
|
||||
; X when X == 16#0000 ->
|
||||
{error, {badjson, <<D/?utfx, Rest/binary>>}}
|
||||
%% anything else
|
||||
; X ->
|
||||
string(Rest, Stack, Opts, <<String/binary, X/utf8>>)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue