Rust: Exclude taint-read-steps for axum::extract::state::State - #22471
Open
hvitved wants to merge 2 commits into
Open
Rust: Exclude taint-read-steps for axum::extract::state::State#22471hvitved wants to merge 2 commits into
axum::extract::state::State#22471hvitved wants to merge 2 commits into
Conversation
hvitved
force-pushed
the
rust/exclude-axum-state-steps
branch
from
September 1, 2026 07:41
c755197 to
6136137
Compare
hvitved
force-pushed
the
rust/exclude-axum-state-steps
branch
from
September 1, 2026 08:12
6136137 to
b96552d
Compare
hvitved
marked this pull request as ready for review
September 1, 2026 09:11
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The test does not cover the tuple-struct parameter destructuring used by the reported regression.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
rust/ql/test/library-tests/dataflow/sources/web_frameworks/test.rs — This regression test exercises a field expression, but the reported Axum case destructures the… |
What changed in this PR
Prevents Axum application state from propagating remote taint while preserving taint for request-controlled handler inputs.
Changes:
- Excludes reads of
State’s inner field from default taint propagation. - Adds an Axum regression handler and updates generated expectations.
| File | Description |
|---|---|
rust/ql/lib/codeql/rust/frameworks/axum.model.yml |
Adds the State(0) taint-step exclusion. |
rust/ql/test/library-tests/dataflow/sources/web_frameworks/test.rs |
Adds regression coverage for state and body parameters. |
rust/ql/test/library-tests/dataflow/sources/web_frameworks/TaintSources.expected |
Updates source expectations. |
rust/ql/test/library-tests/dataflow/sources/web_frameworks/InlineFlow.expected |
Updates flow expectations. |
rust/ql/test/library-tests/dataflow/sources/web_frameworks/CONSISTENCY/TypeInferenceConsistency.expected |
Updates shifted consistency locations. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.

As suggested on #22466, we do not want to consider
Statestruct parameters of handlers as taint sources. We cannot model this exclusion in our existing MaD row, so instead this PR simply prevents taint-flow out of theStatestruct.