mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
JS: Update TaintTracking test
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import 'dummy';
|
||||
|
||||
function makeObject() {
|
||||
return {
|
||||
foo: {
|
||||
bar: {
|
||||
baz: source()
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function test() {
|
||||
const object = makeObject();
|
||||
|
||||
sink(object); // OK
|
||||
sink(JSON.stringify(object)); // NOT OK
|
||||
sink(object); // OK
|
||||
}
|
||||
|
||||
function testCapture() {
|
||||
const object = makeObject();
|
||||
|
||||
sink(object); // OK
|
||||
sink(JSON.stringify(object)); // NOT OK
|
||||
sink(object); // OK - use-use flow should not see the effects of the implicit read in JSON.stringify
|
||||
|
||||
function capture() {
|
||||
object;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user