Repository navigation
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A positive test is missing to verify that taint already attached to a captured value is preserved when read inside a closure.
1 open issue
What changed in this PR
Refines unified taint tracking so tainted closures no longer automatically taint their captured variables.
Changes:
- Restricts read-derived taint steps to taint-inheriting contents.
- Adds Swift regression cases for captures, fields, tuples, and arrays.
| File | Description |
|---|---|
unified/ql/test/library-tests/dataflow/test.expected |
Updates expected dataflow results. |
unified/ql/test/library-tests/dataflow/capture.swift |
Adds taint-inheritance regression cases. |
unified/ql/lib/codeql/unified/internal/dataflow/TaintTrackingInstantiation.qll |
Filters read-derived taint steps. |
unified/ql/lib/codeql/unified/internal/dataflow/Content.qll |
Defines taint-inheriting contents, excluding captured variables. |
Review effort: Max (adaptive)
| DataFlowInput::readStep(src, _, sink) and model = "" | ||
| exists(ContentSet c | | ||
| DataFlowInput::readStep(src, c, sink) and | ||
| c.getAReadContent() instanceof TaintInheritingContent |
Contributor
Author
There was a problem hiding this comment.
Added a regression where a concatenated, already-tainted value is captured and read inside a closure. The focused unified data-flow test passes.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
c107ae17fbf43699d698877b303cb4022a06a40a↓ Full unified test suite was not run.
↓ No broader production reproduction was provided.
Stops converting reads of a captured variable content into a taint step.