Repository navigation
Conversation
hvitved
force-pushed
the
rust/captured-flow-fixes
branch
from
October 28, 2026 14:34
8da4e2d to
5040b9f
Compare
hvitved
marked this pull request as ready for review
October 28, 2026 18:16
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved capture-flow regressions can suppress alerts for parenthesized parameters and self-dependent assignments, while the committed sink baseline contains failed expectations and required regression coverage remains incomplete.
4 open issues
What changed in this PR
This PR refines Rust’s captured-variable data flow to address the Axum State false positive reported in #22912 and account for writes introduced by destructuring patterns.
Changes:
- Distinguishes direct parameters from bindings introduced by destructuring.
- Uses binding and assignment-access nodes to model captured-variable writes.
- Adds Axum closure-capture regression cases and updates dependencies and flow expectations.
| File | Description |
|---|---|
rust/ql/test/query-tests/security/CWE-022/TaintedPathSinks.expected |
Records sink-expectation output for the new cases. |
rust/ql/test/query-tests/security/CWE-022/TaintedPath.expected |
Updates alert and flow-path expectations. |
rust/ql/test/query-tests/security/CWE-022/src/main.rs |
Adds State and Json closure-capture regression cases. |
rust/ql/test/query-tests/security/CWE-022/options.yml |
Adds the Axum test dependency. |
rust/ql/test/query-tests/security/CWE-022/Cargo.lock |
Locks Axum and related test dependencies. |
rust/ql/test/library-tests/dataflow/models/models.expected |
Updates captured-variable provenance paths. |
rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected |
Updates local-flow write-node expectations. |
rust/ql/test/library-tests/dataflow/lambdas/inline-flow.expected |
Updates closure and async capture-flow paths. |
rust/ql/lib/codeql/rust/internal/typeinference/TypeInference.qll |
Uses the direct-parameter check for self definitions. |
rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll |
Adds a direct-parameter predicate and clarifies binding documentation. |
rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll |
Revises captured-parameter handling and write-node mapping. |
Review effort: Max
hvitved
marked this pull request as draft
October 29, 2026 07:42
hvitved
force-pushed
the
rust/captured-flow-fixes
branch
from
October 29, 2026 10:22
5040b9f to
2b8d678
Compare
hvitved
force-pushed
the
rust/captured-flow-fixes
branch
from
October 29, 2026 12:28
2b8d678 to
6afe533
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Fixes various data flow issues uncovered by this report: