JS: Recognize subclasses of HTMLElement in domValueRef

This commit is contained in:
Asger Feldthaus
2022-04-07 09:51:26 +02:00
parent cff8dc0537
commit 4eda6f643f
3 changed files with 20 additions and 0 deletions

View File

@@ -420,6 +420,13 @@ module DOM {
t.startInProp("target") and
result = domEventSource()
or
t.start() and
exists(DataFlow::ClassNode cls |
cls.getASuperClassNode().getALocalSource() =
DataFlow::globalVarRef(any(string s | s.matches("HTML%Element"))) and
result = cls.getAReceiverNode()
)
or
exists(DataFlow::TypeTracker t2 | result = domValueRef(t2).track(t2, t))
}