mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
JS: Include content properties in type-tracker properties
Reminder: we have two PropertyName classes because the one in Contents.qll can't depend on DataFlow::Node.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import javascript
|
||||
private import semmle.javascript.dataflow.TypeTracking
|
||||
private import semmle.javascript.internal.CachedStages
|
||||
private import semmle.javascript.dataflow.internal.Contents as Contents
|
||||
private import sharedlib.SummaryTypeTracker as SummaryTypeTracker
|
||||
private import FlowSteps
|
||||
|
||||
@@ -30,6 +31,8 @@ private module Cached {
|
||||
SharedTypeTrackingStep::loadStoreStep(_, _, _, this)
|
||||
or
|
||||
this = DataFlow::PseudoProperties::arrayLikeElement()
|
||||
or
|
||||
this instanceof Contents::Private::PropertyName
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ function m5() {
|
||||
// Store and read to a property that isn't mentioned anywhere in the source code.
|
||||
const store = mkSummary("Argument[0]", "ReturnValue.Member[propOnlyMentionedInSummary]");
|
||||
const read = mkSummary("Argument[0].Member[propOnlyMentionedInSummary]", "ReturnValue");
|
||||
sink(read(store(source("m5.1")))); // $ MISSING: track=m5.1
|
||||
sink(read(store(source("m5.1")))); // $ track=m5.1
|
||||
sink(read(source("m5.1")));
|
||||
sink(store(source("m5.1")));
|
||||
sink(store(read(source("m5.1"))));
|
||||
|
||||
Reference in New Issue
Block a user