Skip to content

Commit 6630624

Browse files
committed
Rust: Implicit deref at sinks for taint tracking
1 parent 45d6fc0 commit 6630624

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ module RustTaintTracking implements InputSig<Location, RustDataFlow> {
4141
succ.asExpr() = index
4242
)
4343
or
44-
// Although data flow through collections is modeled using stores/reads,
45-
// we also allow taint to flow out of a tainted collection. This is
46-
// needed in order to support taint-tracking configurations where the
47-
// source is a collection.
48-
exists(SingletonContentSet cs |
49-
RustDataFlow::readStep(pred, cs, succ) and
44+
// Although data flow through collections and references is modeled using
45+
// stores/reads, we also allow taint to flow out of a tainted collection.
46+
// This is needed in order to support taint-tracking configurations where
47+
// the source is a collection or reference.
48+
exists(SingletonContentSet cs | RustDataFlow::readStep(pred, cs, succ) |
5049
cs.getContent() instanceof ElementContent
50+
or
51+
cs.getContent() instanceof ReferenceContent
5152
)
5253
or
5354
exists(FormatArgsExprCfgNode format | succ.asExpr() = format |

0 commit comments

Comments
 (0)