Update dependency semgrep to v1.43.0 #57
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.41.0
->1.43.0
Release Notes
returntocorp/semgrep (semgrep)
v1.43.0
Compare Source
Added
most Semgrep constructs (and Semgrep itself) would not work correctly. (pa-2968)
Changed
Typically, running a rule on a file should take a fraction of a second. When a rule
takes more than a couple of seconds is often because the rule is not optimally
written, or because the file is unusually large (a minified file or machine-
generated code), so waiting 30s for it does not tend to bring any value. Plus, by
cutting it earlier, we may prevent a potential OOM crash when running the rule is
very memory intensive. (pa-3155)
Fixed
v1.42.0
Compare Source
Added
Rule-writing: Capture group metavariables used in regexes in a
metavariable-regex
can now introduce their bindings into thescope of the pattern, similarly to
metavariable-pattern
.For instance, in the pattern:
patterns:
foo($BAR)
metavariable: $BAR
regex: "(?.*)end"
the rule will match the contents of what is inside of the
foo
to the regex that binds anything before an "end" tothe metavariable
$X
. This metavariable can then be focusedat a later time, or processed somewhere above this pattern. (pa-3011)
Try-catch-else-finally is now supported in taint analysis.
This change also includes some updates to our analysis. Previously we assumed that
any statement inside the try clause may throw an exception, but now only
function calls are assumed to possibly throw exceptions.
Throw statements always throw an exception as it was before.
This kind of statement is supported in languages including Python, Ruby, and Julia.
Python example:
a is not tainted because exception wasn't assumed to be thrown
b is tainted through the else clause
c is tainted at the beginning, but it was not sanitized
because an exception was not thrown
d is tainted at the beginning, but it was sanitized
because the finally clause is always executed
Pro: Semgrep can now derive facts about constants from equality tests.
For example, pattern
foobar(&nullptr)
will not match here:But it will match here:
Metavariable-type rule support for C, C++
Users now can use metavariable-type rules in both C and C++. For instance, the
provided code snippet:
can be matched by the following rule:
C/C++: If conditions such as
if (int x = f())
are now correctly translatedinto the Dataflow IL, so Semgrep can report a finding in the example below:
Changed
Fixed
The CLI autocompletion code has been removed. It was not currently working
and nobody reported it, which probably means nobody was using it. (autocomplete)
The --core-opts flag has been removed. (core_opts)
fix: metavariable-type now correctly matches non-primitive types in php (gh-8781)
fixed the regression in --registry-caching and add better error message
to tell the user he needs also --experimental. (gh-8828)
Support labeled let bindings within Swift case statements
Correctly parsing labeled let bindings within Swift case statements.
For instance, the code snippet:
now successfully matches the pattern:
Add parsing support for various rare Swift constructs (swift-parsing)
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.