Skip to content

Commit 67a4cff

Browse files
committed
Rust: Also lift read steps in summaries as taint steps
1 parent fef00c1 commit 67a4cff

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

rust/ql/lib/codeql/rust/dataflow/internal/TaintTrackingImpl.qll

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,9 @@ module RustTaintTracking implements InputSig<Location, RustDataFlow> {
5252
// Read steps give rise to taint steps. This has the effect that if `foo`
5353
// is tainted and an operation reads from `foo` (e.g., `foo.bar`) then
5454
// taint is propagated.
55-
exists(Content c |
56-
RustDataFlow::readContentStep(pred, c, succ) and
57-
not excludedTaintStepContent(c)
58-
)
59-
or
60-
// In addition to the above, for element and reference content we let
61-
// _all_ read steps (including those from flow summaries and those that
62-
// result in small primitive types) give rise to taint steps.
63-
exists(SingletonContentSet cs | RustDataFlow::readStep(pred, cs, succ) |
64-
cs.getContent() instanceof ElementContent
65-
or
66-
cs.getContent() instanceof ReferenceContent
55+
exists(ContentSet cs |
56+
RustDataFlow::readStep(pred, cs, succ) and
57+
not excludedTaintStepContent(cs.getAReadContent())
6758
)
6859
or
6960
exists(FormatArgsExpr format | succ.asExpr() = format |

0 commit comments

Comments
 (0)