Files
codeql/javascript/ql/test/library-tests/TaintBarriers/sanitizer-in-out.js
2023-07-11 11:37:30 +02:00

19 lines
462 B
JavaScript

import 'dummy';
function barrierIn() {
var sourceVariable = 123;
SINK(sourceVariable); // NOT OK
flowWithSourceParam(sourceVariable);
}
function barrierInParameter(sourceVariable) {
SINK(sourceVariable); // NOT OK, but only report the parameter as the source
}
function barrierOut() {
let taint = SOURCE();
taint = "<sink>" + taint + "</sink>"; // NOT OK
taint = "<sink>" + taint + "</sink>"; // OK - only report first instance
}