8000 C++: mass enable diff-informed data flow by d10c · Pull Request #19663 · github/codeql · GitHub
[go: up one dir, main page]

Skip to content

C++: mass enable diff-informed data flow #19663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
C++: mass enable diff-informed data flow
An auto-generated patch that enables diff-informed data flow in the obvious cases.

Builds on #18342 and github/codeql-patch#88
  • Loading branch information
d10c committed Jun 11, 2025
commit 4dd07f475b7c7ecfba42ea4d7f3a1003f166b69f
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ module PrivateCleartextWrite {
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }

predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }

predicate observeDiffInformedIncrementalMode() { any() }
}

module WriteFlow = TaintTracking::Global<WriteConfig>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ module CastToPointerArithFlowConfig implements DataFlow::StateConfigSig {
predicate isBarrierIn(DataFlow::Node node) { isSource(node, _) }

predicate isBarrierOut(DataFlow::Node node) { isSink(node, _) }

predicate observeDiffInformedIncrementalMode() { any() }
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ private module NetworkToBufferSizeConfig implements DataFlow::ConfigSig {
gc.controls(node.asExpr().getBasicBlock(), _)
)
}

predicate observeDiffInformedIncrementalMode() { any() }
}

module NetworkToBufferSizeFlow = DataFlow::Global<NetworkToBufferSizeConfig>;
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ module Config implements DataFlow::ConfigSig {
or
node.asCertainDefinition().getUnspecifiedType() instanceof ArithmeticType
}

predicate observeDiffInformedIncrementalMode() { any() }
}

module Flow = TaintTracking::Global<Config>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ module ImproperArrayIndexValidationConfig implements DataFlow::ConfigSig {
not offsetIsAlwaysInBounds(arrayExpr, offsetExpr)
)
}

predicate observeDiffInformedIncrementalMode() { any() }
}

module ImproperArrayIndexValidation = TaintTracking::Global<ImproperArrayIndexValidationConfig>;
Expand Down
2 changes: 2 additions & 0 deletions cpp/ql/src/Security/CWE/CWE-134/UncontrolledFormatString.ql
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ module Config implements DataFlow::ConfigSig {
or
isArithmeticNonCharType(node.asCertainDefinition().getUnspecifiedType())
}

predicate observeDiffInformedIncrementalMode() { any() }
}

module Flow = TaintTracking::Global<Config>;
Expand Down
2 changes: 2 additions & 0 deletions cpp/ql/src/Security/CWE/CWE-190/IntegerOverflowTainted.ql
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ module Config implements DataFlow::ConfigSig {
not iTo instanceof PointerArithmeticInstruction
)
}

predicate observeDiffInformedIncrementalMode() { any() }
}

module Flow = TaintTracking::Global<Config>;
Expand Down
2 changes: 2 additions & 0 deletions cpp/ql/src/Security/CWE/CWE-497/ExposedSystemData.ql
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ module ExposedSystemDataConfig implements DataFlow::ConfigSig {
predicate isBarrier(DataFlow::Node node) {
node.asIndirectArgument() = any(MemsetFunction func).getACallToThisFunction().getAnArgument()
}

predicate observeDiffInformedIncrementalMode() { any() }
}

module ExposedSystemData = TaintTracking::Global<ExposedSystemDataConfig>;
Expand Down
F438
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ module PotentiallyExposedSystemDataConfig implements DataFlow::ConfigSig {
predicate isBarrier(DataFlow::Node node) {
node.asIndirectArgument() = any(MemsetFunction func).getACallToThisFunction().getAnArgument()
}

predicate observeDiffInformedIncrementalMode() { any() }
}

module PotentiallyExposedSystemData = TaintTracking::Global<PotentiallyExposedSystemDataConfig>;
Expand Down
2 changes: 2 additions & 0 deletions cpp/ql/src/Security/CWE/CWE-611/XXE.ql
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ module XxeConfig implements DataFlow::StateConfigSig {
}

predicate neverSkip(DataFlow::Node node) { none() }

predicate observeDiffInformedIncrementalMode() { any() }
}

module XxeFlow = DataFlow::GlobalWithState<XxeConfig>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ module WordexpTaintConfig implements DataFlow::ConfigSig {
predicate isBarrier(DataFlow::Node node) {
node.asExpr().getUnspecifiedType() instanceof IntegralType
}

predicate observeDiffInformedIncrementalMode() { any() }
}

module WordexpTaint = TaintTracking::Global<WordexpTaintConfig>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ module MultToAllocConfig implements DataFlow::ConfigSig {
// something that affects an allocation size
node.asExpr() = any(HeuristicAllocationExpr ae).getSizeExpr().getAChild*()
}

predicate observeDiffInformedIncrementalMode() { any() }
}

module MultToAlloc = DataFlow::Global<MultToAllocConfig>;
Expand Down
0