Skip to content

Commit 1462176

Browse files
committed
JS: add window.name as DOM-based remote flow source
1 parent a4b3b1e commit 1462176

File tree

1 file changed

+15
-1
lines changed
  • javascript/ql/src/semmle/javascript/security/dataflow

1 file changed

+15
-1
lines changed

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,4 +199,18 @@ private class PostMessageEventParameter extends RemoteFlowSource {
199199
override string getSourceType() {
200200
result = "postMessage event"
201201
}
202-
}
202+
}
203+
204+
/**
205+
* An access to `window.name`, which can be controlled by the opener of the window,
206+
* even if the window is opened from a foreign domain.
207+
*/
208+
private class WindowNameAccess extends RemoteFlowSource {
209+
WindowNameAccess() {
210+
this = DataFlow::globalVarRef("name")
211+
}
212+
213+
override string getSourceType() {
214+
result = "Window name"
215+
}
216+
}

0 commit comments

Comments
 (0)