Skip to content

Commit 03b4791

Browse files
committed
JS: preserve document.url label out of .href property
1 parent ea297dd commit 03b4791

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

javascript/ql/src/semmle/javascript/security/dataflow/ClientSideUrlRedirect.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ module ClientSideUrlRedirect {
6565
queryAccess(pred, succ) and
6666
f instanceof DocumentUrl and
6767
g = DataFlow::FlowLabel::taint()
68+
or
69+
// preserve document.url label in step from `location` to `location.href`
70+
f instanceof DocumentUrl and
71+
g instanceof DocumentUrl and
72+
succ.(DataFlow::PropRead).accesses(pred, "href")
6873
}
6974
}
7075

0 commit comments

Comments
 (0)