Skip to content

Commit c4b717b

Browse files
committed
Added test case for escape.
1 parent a3ef137 commit c4b717b

File tree

1 file changed

+7
-0
lines changed
  • javascript/ql/test/query-tests/Security/CWE-022/TaintedPath

1 file changed

+7
-0
lines changed

javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,10 @@ var server = http.createServer(function(req, res) {
208208
}
209209
});
210210

211+
var srv = http.createServer(function(req, res) {
212+
let path = url.parse(req.url, true).query.path; // $ MISSING: Source
213+
const improperEscape = escape(path);
214+
res.write(fs.readFileSync(improperEscape)); // $ MISSING: Alert
215+
const improperEscape2 = unescape(path);
216+
res.write(fs.readFileSync(improperEscape2)); // $ MISSING: Alert
217+
});

0 commit comments

Comments
 (0)