Skip to content
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

taint-mode: Check variables as if they were subexpressions #4323

Merged
merged 1 commit into from Nov 30, 2021

Conversation

IagoAbal
Copy link
Contributor

If the LHS of ->foo was a sink, and we encountered x->foo where x
was a variable, we did not report a finding even if x was tainted. We
were not checking whether x was in a sink position.

Although they are not represented as such in the IL, variables are
themselves subexpressions, so we must check whether they are sinks or
sanitized.

Closes #4320

test plan:
make test # test included

PR checklist:

  • Documentation is up-to-date
  • Changelog is up-to-date
  • Change has no security implications (otherwise, ping security team)

If the LHS of `->foo` was a sink, and we encountered `x->foo` where `x`
was a variable, we did not report a finding even if `x` was tainted. We
were not checking whether `x` was in a sink position.

Although they are not represented as such in the IL, variables are
themselves subexpressions, so we must check whether they are sinks or
sanitized.

Closes #4320

test plan:
make test # test included
@github-actions
Copy link
Contributor

🔥 Potential speedup in benchmark semgrep.bench.apache.std: -44.7% (-6.902 s)

14 benchmarks, 0.6% faster on average.

Individual deviations greater than 20% from the baseline are reported. An individual performance degradation of over 30% or a global degradation of over 7% is an error and will block the pull request. See run output for full results ('Show all checks' > 'Tests / semgrep benchmark tests' 'Details').

@IagoAbal IagoAbal merged commit 0405a6d into develop Nov 30, 2021
@IagoAbal IagoAbal deleted the iago/4320 branch November 30, 2021 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Taint mode in PHP doesn't work on object that method is called on
2 participants