New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enforce metavariable equality between sources/sinks/sanitizers, and show metavariables in taint mode messages #4073
Enforce metavariable equality between sources/sinks/sanitizers, and show metavariables in taint mode messages #4073
Conversation
…mpare them but should be changed everywhere
PA-313 Metavariable equality between sources, sanitizers and sink specifications
Right now each spec is independent, if you match $MVAR in a source and in a sink these are considered two different variables. We should require that all $MVAR matches are consistent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want the core to depends on analyzing. There has to be a way to avoid this dependency.
In fact in core/dune we should remove pfff-lang_GENERIC-analyze, it's not currently needed; not sure why it was there in the first place.
Maybe you can move Dataflow_tainting.ml in engine/, and add a note that it used to be in analyzing/, but with |
…e are multiple ways something could be a sink
…f github.com:returntocorp/semgrep into matthew/pa-313-metavariable-equality-between-sources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asking for more comments mostly.
Sorry that I missed the initial context. @mmcqd was the |
We can now write rules that use the same metavariable across sources/sinks/sanitizers, and refer to these metavariables in match messages. Currently if a sink could be matched with multiple possible metavariable assignments it will be matched twice by
semgrep-core
, butsemgrep
will filter out all but one of these matches.PR checklist: