C++: Remove CP in cpp/command-line-injection#10123
Conversation
|
I find the original behaviour somewhat unexpected, as that seems to indicate there's no inherent connection between the flow path and its eventual sink, on the one hand, and the flow state, on the other hand. In wonder if this is a restriction of the implementation or an actual bug. It's also not clear to me why this wouldn't have resulted in FPs before this change. |
|
Or is this just a consequence of bottom-up evaluation? |
Yeah, exactly. What currently happens on main is that we first evaluate the giant cartesian product to compute This PR reduces the set of Does that make sense? |
Absolutely. |
|
I think perhaps this query was trying to be a bit too clever with flow states. From what I understand of what its doing I'd probably have written it with just two, "safe" and "dangerouslyConcatenated". This would mean we get less detail in the violation message, so assuming its robust this fix is probably to be preferred. |
Yeah. I had something like that originally. However, that made it impossible to report anything about the location of the concatenation, which would have been a major regression compared to the two stitched together dataflow configurations that were there previously. |
|
I do think reporting the location of the concatenation is very helpful. I can imagine that would be a natural place to insert a sanitizer (or whatever people would do to fix the vulnerability). |
Prior to this PR, the sink in
ExecTaintConfigurationwas a cartesian product between all concatenation-like functions and all shell-command executing functions (😱) This PR introduces another taint tracking configuration that limits the possible flow states to only those that are relevant for a given sink.Here are some numbers from Samate:
On
main:On this PR: