Skip to content

Help with control-flow taint propagation #17496

Answered by jketema
marpom asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @marpom,

Thanks for your question.

Looking at your imports, it seems that you already briefly explored the IR. The IR would indeed provided the easiest solution here, by looking at the StoreInstructions that happen in the body, and which will derive from the expressions in the body. Limiting myself to loop statements, slightly generalising the sources (for my own testing pusposes), and making the sink more specific. I would do something like the following:

/**
 * @id cpp/test
 * @kind path-problem
 * @problem.severity warning
 */

import cpp
import semmle.code.cpp.dataflow.new.TaintTracking
import semmle.code.cpp.ir.IR
import SampleFlow::PathGraph

module SampleConfig implements DataFlow

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@marpom
Comment options

@jketema
Comment options

@marpom
Comment options

Answer selected by marpom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants