Skip to content

Commit 4114e32

Browse files
huntr.dev | the place to protect open sourceready-research
huntr.dev | the place to protect open source
andauthoredApr 26, 2021
Fix Code injection in -d DELIM through use of eval (#150)
Replace eval with JSON.parse This handles the code injection vuln in `-d DELIM`, but introduces a backward incompatibility because JSON escapes are a subset of JavaScript escapes. Co-authored-by: ready-research <72916209+ready-research@users.noreply.github.com> Refs: #148
1 parent 27e1ad7 commit 4114e32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎lib/json.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ if (util.format) {
126126
function _parseString(s) {
127127
/* JSSTYLED */
128128
var quoted = '"' + s.replace(/\\"/, '"').replace('"', '\\"') + '"';
129-
return eval(quoted);
129+
return JSON.parse(quoted);
130130
}
131131

132132
// json_parse.js (<https://github.com/douglascrockford/JSON-js>)

0 commit comments

Comments
 (0)
Please sign in to comment.