The Wayback Machine - http://web.archive.org/web/20251231025541/https://github.com/github/codeql/pull/7687
Skip to content

Conversation

@yoff
Copy link
Contributor

@yoff yoff commented Jan 21, 2022

This removes the FP caused by chaining.

This PR also removes ChainedConfigs12.qll, as we hope to solve future problems via flow states.

I have marked it as not needing a change note, but let me know if you think it does :-)

This removes the FP cause by chaining
This PR also removes `ChainedConfigs12.qll`,
as we hope to solve future problems via flow states.
@yoff yoff requested a review from a team as a code owner January 21, 2022 08:28
@yoff yoff added the no-change-note-required This PR does not need a change note label Jan 21, 2022
yoff added 4 commits January 21, 2022 12:12
This allows a bit more precision. Specifically, we could
 require the sanitizer to only affect `ConvertedToDict`.
 In practice, most sanitizers woudl probably fail on raw
 input also, though.
since it was clearly already used.
Add deprecation message instead.
also update test expectation
Copy link
Member

@RasmusWL RasmusWL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool that you have porting these queries to use flow state 💪 (also great to see that FP removed)

Is there an official doc for how to use flow state? (so I know if you made up the way to handle things, or if there is an established way already)

For python/ql/lib/semmle/python/security/dataflow/PathInjection.qll, I'm wondering how much deprecation we need to support. At least if someone has code that uses the old configurations (or old predicate), their code is going to stop working if this PR is merged as it is right now.

I also have a minor comment for the chained-config qll file, where I think we can mark even more things as deprecated.

@yoff
Copy link
Contributor Author

yoff commented Jan 25, 2022

Is there an official doc for how to use flow state? (so I know if you made up the way to handle things, or if there is an established way already)

I am not aware of any official doc, so this is all made up, but it seemed pretty intuitive :-)
(I am happy for best practices to evolve, though. JavaScript has a fairly advanced flow-state based query for path injection that we should probably attempt to port at some point.)

@yoff
Copy link
Contributor Author

yoff commented Jan 25, 2022

Good point about the old configuration being public. We may have to leave it deprecated instead of deleting it.

I am slightly concerned that the test now generates many more
intermediate results. I suppose that maes the analysis heavy.
Should the new library get a new name instead, so the old code
does not get evaluated?
@yoff yoff requested a review from RasmusWL January 31, 2022 07:34
Copy link
Member

@RasmusWL RasmusWL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 with the deprecations.

I'm still a bit surprised that the flow-state specific sanitizer is isBarrier/2, but 🤷

Out of interest, did you come up with the scheme of blocking flow for the old state when there is a state transition that occurs? (as with the barrier for NoSQL injection) I guess it helps with performance on the data-flow library, so I can see the benefit for sure 👍

@yoff
Copy link
Contributor Author

yoff commented Feb 1, 2022

Out of interest, did you come up with the scheme of blocking flow for the old state when there is a state transition that occurs?

Yes. I guess we should get the conversation going about how to actually use flow states effectively, but in many cases it has to be blocked or it will reach the sink.

@yoff
Copy link
Contributor Author

yoff commented Feb 1, 2022

I'm still a bit surprised that the flow-state specific sanitizer is isBarrier/2, but

I think it is because it is implemented for the data flow configurations, and no taint-specific veneer has been added to taint configurations...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-change-note-required This PR does not need a change note Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants