JS: Track taint through exceptions

This commit is contained in:
Asger F
2019-04-30 18:34:25 +01:00
parent 639d715d03
commit 36cefd8fc6
4 changed files with 154 additions and 6 deletions

View File

@@ -0,0 +1,33 @@
function test(unsafe, safe) {
try {
throw2(source());
} catch (e) {
sink(e);
}
try {
throw2(unsafe);
} catch (e) {
sink(e);
}
try {
throw2(safe);
} catch (e) {
sink(e); // OK
}
}
function throw2(x) {
throw1(x);
throw1(x); // no single-call inlining
}
function throw1(x) {
throw x;
}
test(source(), "hello");
test("hey", "hello"); // no single-call inlining