You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This package commits the cardinal sin of escaping: failing to fully exempt non-escaped input from unescaping (e.g., escapeKey escapes each . as \. but fails to escape \ itself). As a result, there are some injection bugs: https://jsfiddle.net/euqLwk4r/
input
({a: ["/'a'[0]: string that becomes a regex/"],'a.0': /'a.0':regexthatbecomesastring/,'b.0': "/'b.0': string that becomes a regex/",'b\\': [/'b\\'[0]:regexthatbecomesastring/],})
encodes to
{
"json": {
"a": [ "/'a'[0]: string that becomes a regex/" ],
"a.0": "/'a.0': regex that becomes a string/",
"b.0": "/'b.0': string that becomes a regex/",
"b\\": [ "/'b\\\\'[0]: regex that becomes a string/" ]
},
"meta": {
"values": {
"a.0": [ "regexp" ],
"b\\.0": [ "regexp" ]
}
}
}
which decodes as the input-dissimilar
({a: [/'a'[0]:stringthatbecomesaregex/],'a.0': "/'a.0': regex that becomes a string/",'b.0': /'b.0':stringthatbecomesaregex/,'b\\': ["/'b\\\\'[0]: regex that becomes a string/"],})
The text was updated successfully, but these errors were encountered:
Thanks for the report, this makes sense to me. You're the first in quite a long time to report this, so at least it's not a giant impact. Do you see a way for us to fix this without breaking changes?
This package commits the cardinal sin of escaping: failing to fully exempt non-escaped input from unescaping (e.g.,
escapeKey
escapes each.
as\.
but fails to escape\
itself). As a result, there are some injection bugs: https://jsfiddle.net/euqLwk4r/input
encodes to
which decodes as the input-dissimilar
The text was updated successfully, but these errors were encountered: