Skip to content

Unified: Lift read steps to taint steps - #23295

Open
hvitved wants to merge 1 commit into
github:mainfrom
hvitved:hvitved-unified-read-taint-steps
Open

hvitved wants to merge 1 commit into
github:mainfrom
hvitved:hvitved-unified-read-taint-steps

Conversation

@hvitved

@hvitved hvitved commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

As we have discussed before, this PR lifts all read steps to taint steps (similar to Rust). Eventually we will want to restrict this (similar to Rust), but I think we can do that once we start seeing FPs.

DCA shows, not surprisingly, an increase in taint reach and alerts. I have not looked at any of the new alerts.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new read steps propagate taint through numeric scalar properties, causing injection-query false positives that need query-specific numeric barriers and a negative regression test.

1 open issue
What changed in this PR

Updates unified taint tracking so values read from tainted containers inherit taint, following the Rust implementation.

Changes:

  • Lifts dataflow read steps into default taint steps.
  • Adds a Swift subscript regression case.
  • Updates inline expectations and generated results for newly detected flows.
File Description
unified/​ql/​test/​query-tests/​security/​CWE-312/​CleartextLogging/​CleartextLoggingTest.swift Updates inline expectations for newly detected logging flows.
unified/​ql/​test/​query-tests/​security/​CWE-312/​CleartextLogging/​CleartextLogging.expected Records additional logging results and taint paths.
unified/​ql/​test/​query-tests/​security/​CWE-022/​PathInjection/​testPathInjection.swift Marks the filePathURL case as a detected alert.
unified/​ql/​test/​query-tests/​security/​CWE-022/​PathInjection/​PathInjectionTest.expected Records the newly detected path-injection flow.
unified/​ql/​test/​library-tests/​dataflow/​test.expected Updates dataflow results and source locations.
unified/​ql/​test/​library-tests/​dataflow/​subscripts.swift Adds a tainted-container subscript regression case.
unified/​ql/​lib/​codeql/​unified/​internal/​dataflow/​TaintTrackingInstantiation.qll Promotes read steps to default taint steps.

Review effort: Max (adaptive)

step(src, any(Step s | s.taint()), sink) and model = ""
or
// Read steps give rise to taint steps.
DataFlowInput::readStep(src, _, sink) and model = ""
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@hvitved
hvitved force-pushed the hvitved-unified-read-taint-steps branch from 990642f to 51faf17 Compare November 30, 2026 13:09
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Dec 1, 2026
@hvitved
hvitved marked this pull request as ready for review December 1, 2026 08:09
@hvitved
hvitved requested a review from a team as a code owner December 1, 2026 08:09
@hvitved
hvitved requested a review from asgerf December 1, 2026 08:09

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-change-note-required This PR does not need a change note Unified

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants