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.
This commit is contained in:
Asger F
2025-10-10 21:37:01 +02:00
parent cf0e7652f4
commit c687dc93b0
7 changed files with 8 additions and 0 deletions

View File

@@ -192,6 +192,7 @@ module DOM {
* A data flow node or other program element that may refer to
* a DOM element.
*/
overlay[global]
abstract class Element extends Locatable {
ElementDefinition defn;

View File

@@ -94,6 +94,7 @@ module EventRegistration {
/**
* A registration of an event handler on an EventEmitter.
*/
overlay[global]
abstract class Range extends DataFlow::Node {
EventEmitter::Range emitter;
@@ -148,6 +149,7 @@ module EventDispatch {
/**
* A dispatch of an event on an EventEmitter.
*/
overlay[global]
abstract class Range extends DataFlow::Node {
EventEmitter::Range emitter;

View File

@@ -260,6 +260,7 @@ module NodeJSLib {
DataFlow::Node getRouteHandlerNode() { result = handler }
}
overlay[global]
abstract private class HeaderDefinition extends Http::Servers::StandardHeaderDefinition {
ResponseNode r;

View File

@@ -16,6 +16,7 @@ module SQL {
* An dataflow node that sanitizes a string to make it safe to embed into
* a SQL command.
*/
overlay[global]
abstract class SqlSanitizer extends DataFlow::Node {
DataFlow::Node input;
DataFlow::Node output;

View File

@@ -129,6 +129,7 @@ module SecondOrderCommandInjection {
/**
* A sink that invokes a command described by the `VulnerableCommand` class.
*/
overlay[global]
abstract class VulnerableCommandSink extends Sink {
VulnerableCommand cmd;

View File

@@ -194,6 +194,7 @@ module TaintedPath {
* There are currently four flow labels, representing the different combinations of
* normalization and absoluteness.
*/
overlay[global]
abstract class PosixPath extends DataFlow::FlowLabel {
Normalization normalization;
Relativeness relativeness;

View File

@@ -101,6 +101,7 @@ module UnsafeHtmlConstruction {
* A sink for `js/html-constructed-from-input` that constructs some HTML where
* that HTML is later used in `xssSink`.
*/
overlay[global]
abstract class XssSink extends Sink {
DomBasedXss::Sink xssSink;