Skip to content

Commit e90e374

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 8aa6e54 commit e90e374

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
@@ -192,6 +192,7 @@ module DOM {
192192
* A data flow node or other program element that may refer to
193193
* a DOM element.
194194
*/
195+
overlay[global]
195196
abstract class Element extends Locatable {
196197
ElementDefinition defn;
197198

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ module EventRegistration {
9494
/**
9595
* A registration of an event handler on an EventEmitter.
9696
*/
97+
overlay[global]
9798
abstract class Range extends DataFlow::Node {
9899
EventEmitter::Range emitter;
99100

@@ -148,6 +149,7 @@ module EventDispatch {
148149
/**
149150
* A dispatch of an event on an EventEmitter.
150151
*/
152+
overlay[global]
151153
abstract class Range extends DataFlow::Node {
152154
EventEmitter::Range emitter;
153155

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
@@ -16,6 +16,7 @@ module SQL {
1616
* An dataflow node that sanitizes a string to make it safe to embed into
1717
* a SQL command.
1818
*/
19+
overlay[global]
1920
abstract class SqlSanitizer extends DataFlow::Node {
2021
DataFlow::Node input;
2122
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
@@ -129,6 +129,7 @@ module SecondOrderCommandInjection {
129129
/**
130130
* A sink that invokes a command described by the `VulnerableCommand` class.
131131
*/
132+
overlay[global]
132133
abstract class VulnerableCommandSink extends Sink {
133134
VulnerableCommand cmd;
134135

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ module TaintedPath {
194194
* There are currently four flow labels, representing the different combinations of
195195
* normalization and absoluteness.
196196
*/
197+
overlay[global]
197198
abstract class PosixPath extends DataFlow::FlowLabel {
198199
Normalization normalization;
199200
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
@@ -101,6 +101,7 @@ module UnsafeHtmlConstruction {
101101
* A sink for `js/html-constructed-from-input` that constructs some HTML where
102102
* that HTML is later used in `xssSink`.
103103
*/
104+
overlay[global]
104105
abstract class XssSink extends Sink {
105106
DomBasedXss::Sink xssSink;
106107

0 commit comments

Comments
 (0)