Skip to content

Diff-informed queries: phase 3 (non-trivial locations) #19957

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

Draft
wants to merge 102 commits into
base: main
Choose a base branch
from

Conversation

d10c
Copy link
Contributor

@d10c d10c commented Jul 2, 2025

This PR enables diff-informed mode on queries that select a location other than dataflow source or sink.

I start with automatically generated stubs and then handle each TODO item in its own commit.

@github-actions github-actions bot added C# JS C++ Java Python Go Ruby Rust Pull requests that update Rust code Swift Actions Analysis of GitHub Actions labels Jul 2, 2025
@d10c d10c force-pushed the d10c/diff-informed-phase-3 branch from ff3a4b9 to 95fe462 Compare July 3, 2025 15:50
@@ -3,6 +3,7 @@
private import codeql.actions.dataflow.ExternalFlow
private import codeql.actions.security.ArtifactPoisoningQuery
private import codeql.actions.security.UntrustedCheckoutQuery
private import codeql.actions.security.ControlChecks

Check warning

Code scanning / CodeQL

Redundant import Warning

Redundant import, the module is already imported inside
codeql.actions.security.ArtifactPoisoningQuery
.
@d10c d10c force-pushed the d10c/diff-informed-phase-3 branch 3 times, most recently from aff62c2 to 6d0ae3a Compare July 4, 2025 14:20
@@ -0,0 +1 @@
experimental/Security/CWE-208/TimingAttackAgainstHash/TimingAttackAgainstHash.ql

Check warning

Code scanning / CodeQL

Query test without inline test expectations Warning test

Query test does not use inline test expectations.
@d10c d10c force-pushed the d10c/diff-informed-phase-3 branch 2 times, most recently from c871f5e to 276c7f0 Compare July 7, 2025 09:42
Comment on lines +39 to +45
result = source.getLocation()
or
exists(DataFlow::Node node | result = node.getLocation() |
sensitiveAssignment(node, _, _)
or
hardcodedPrivateKey(node, _)
)

Check warning

Code scanning / CodeQL

Var only used in one side of disjunct. Warning

The
variable source
is only used in one side of disjunct.
Comment on lines +49 to +55
result = sink.getLocation()
or
exists(DataFlow::Node node | result = node.getLocation() |
sensitiveAssignment(_, node, _)
or
hardcodedPrivateKey(node, _)
)

Check warning

Code scanning / CodeQL

Var only used in one side of disjunct. Warning

The
variable sink
is only used in one side of disjunct.
@d10c d10c force-pushed the d10c/diff-informed-phase-3 branch 2 times, most recently from cb2db2f to c70036d Compare July 8, 2025 15:30
Comment on lines +38 to +43
exists(QueryInjectionSink query, Expr uncontrolled |
result = [query.getLocation(), uncontrolled.getLocation()] and
builtFromUncontrolledConcat(query.asExpr(), uncontrolled)
)
or
result = sink.getLocation()

Check warning

Code scanning / CodeQL

Var only used in one side of disjunct. Warning

The
variable sink
is only used in one side of disjunct.
Comment on lines +152 to +154
result = source.getLocation()
or
result = any(MethodCallInsecureFileCreation m).getLocation()

Check warning

Code scanning / CodeQL

Var only used in one side of disjunct. Warning

The
variable source
is only used in one side of disjunct.
Comment on lines +24 to +26
unsafeTrust instanceof RabbitMQEnableHostnameVerificationNotSet
or
sink.asExpr() = unsafeTrust

Check warning

Code scanning / CodeQL

Var only used in one side of disjunct. Warning

The
variable sink
is only used in one side of disjunct.
@d10c d10c force-pushed the d10c/diff-informed-phase-3 branch from c70036d to 08c4cc2 Compare July 9, 2025 16:47
Comment on lines +47 to +50
call.getArgument(1).getValue().toInt() != 0 and
call.getArgument(2) instanceof NullValue
or
sink.asExpr() = call.getArgument(2)

Check warning

Code scanning / CodeQL

Var only used in one side of disjunct. Warning

The
variable sink
is only used in one side of disjunct.
@d10c d10c force-pushed the d10c/diff-informed-phase-3 branch from 08c4cc2 to 857b583 Compare July 10, 2025 17:04
@d10c d10c force-pushed the d10c/diff-informed-phase-3 branch from 857b583 to 3e3e856 Compare July 11, 2025 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Analysis of GitHub Actions C# C++ Go Java JS Python Ruby Rust Pull requests that update Rust code Swift
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy