Skip to content

Commit 777cf5c

Browse files
committed
JS: Add overlay[global] to abstract classes with fields
Some abstract classes defines fields without binding them, leaving it up to the subclasses to bind them. When combined with overlay[local?], the charpred for such an abstract class can become local, while the subclasses are global. The means the charpred needs to be materialized, even though it doesn't bind the fields, leading to a cartesian product.
1 parent 6d1122c commit 777cf5c

File tree

7 files changed

+8
-0
lines changed

7 files changed

+8
-0
lines changed

javascript/ql/lib/semmle/javascript/DOM.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ module DOM {
194194
* A data flow node or other program element that may refer to
195195
* a DOM element.
196196
*/
197+
overlay[global]
197198
abstract class Element extends Locatable {
198199
ElementDefinition defn;
199200

javascript/ql/lib/semmle/javascript/frameworks/EventEmitter.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ module EventRegistration {
9797
/**
9898
* A registration of an event handler on an EventEmitter.
9999
*/
100+
overlay[global]
100101
abstract class Range extends DataFlow::Node {
101102
EventEmitter::Range emitter;
102103

@@ -151,6 +152,7 @@ module EventDispatch {
151152
/**
152153
* A dispatch of an event on an EventEmitter.
153154
*/
155+
overlay[global]
154156
abstract class Range extends DataFlow::Node {
155157
EventEmitter::Range emitter;
156158

javascript/ql/lib/semmle/javascript/frameworks/NodeJSLib.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ module NodeJSLib {
260260
DataFlow::Node getRouteHandlerNode() { result = handler }
261261
}
262262

263+
overlay[global]
263264
abstract private class HeaderDefinition extends Http::Servers::StandardHeaderDefinition {
264265
ResponseNode r;
265266

javascript/ql/lib/semmle/javascript/frameworks/SQL.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ module SQL {
1818
* An dataflow node that sanitizes a string to make it safe to embed into
1919
* a SQL command.
2020
*/
21+
overlay[global]
2122
abstract class SqlSanitizer extends DataFlow::Node {
2223
DataFlow::Node input;
2324
DataFlow::Node output;

javascript/ql/lib/semmle/javascript/security/dataflow/SecondOrderCommandInjectionCustomizations.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ module SecondOrderCommandInjection {
131131
/**
132132
* A sink that invokes a command described by the `VulnerableCommand` class.
133133
*/
134+
overlay[global]
134135
abstract class VulnerableCommandSink extends Sink {
135136
VulnerableCommand cmd;
136137

javascript/ql/lib/semmle/javascript/security/dataflow/TaintedPathCustomizations.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ module TaintedPath {
196196
* There are currently four flow labels, representing the different combinations of
197197
* normalization and absoluteness.
198198
*/
199+
overlay[global]
199200
abstract class PosixPath extends DataFlow::FlowLabel {
200201
Normalization normalization;
201202
Relativeness relativeness;

javascript/ql/lib/semmle/javascript/security/dataflow/UnsafeHtmlConstructionCustomizations.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ module UnsafeHtmlConstruction {
103103
* A sink for `js/html-constructed-from-input` that constructs some HTML where
104104
* that HTML is later used in `xssSink`.
105105
*/
106+
overlay[global]
106107
abstract class XssSink extends Sink {
107108
DomBasedXss::Sink xssSink;
108109

0 commit comments

Comments
 (0)