Update dependency semgrep to v1.78.0 #97
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.72.0
->==1.78.0
Release Notes
returntocorp/semgrep (semgrep)
v1.78.0
Compare Source
Added
Matching of fully qualified type names in the metavariable-type operator has
been improved. For example:
The type of
x
will match botha.b.C
andC
.Fixed
Symbolic propagation now works on decorator functions, for example:
Fixed an issue where Python functions with annotations ending in
endpoint
,route
,get
,patch
,post
,put
,delete
,before_request
orafter_request
(i.e., ones we associate with Flask) were incorrectly analyzedwith the Code product in addition to the Secrets product when present in a file
being ignored for Code analysis but included for Secrets. (scrt-609)
v1.77.0
Compare Source
Added
Semgrep will now report the id of the organization associated with logged in users when reporting metrics in the language server (cdx-508)
Pro: taint-mode: Improved index-sensitive taint tracking for tuple/list (un)packing.
Example 1:
Example 2:
Adds traces to help debug the performance of tainting. To send the traces added in the PR, pass
--trace
and also set the environment variableSEMGREP_TRACE_LEVEL=trace
. To send them to alocal endpoint instead of our default endpoint, use
--trace-endpoint
. (saf-1100)Fixed
Fixed a bug in the generation of the control-flow graph for
try
statements thatcould e.g. cause taint to report false positives:
Semgrep assumes that
clean
could raise an exception, buteven if it does, the tainted
data
will never reach the sink !data
must be clean herethe metrics.semgrep.dev server such as "cannot read property 'map' of undefined". (metrics_error)
dependencies whose package name does not end in a version constraint. (sc-1568)
v1.76.0
Compare Source
Added
Added type inference support for basic operators in the Pro engine, including
+
,-
,*
,/
,>
,>=
,<=
,<
,==
,!=
, andnot
. For numericcomputation operators such as
+
and-
, if the left-hand side and right-handside types are equal, the return type is assumed to be the same. Additionally,
comparison operators like
>
and==
, as well as the negation operatornot
,are assumed to return a boolean type. (code-6940)
Added guidance for resolving token issues for
install-semgrep-pro
in non-interactive environments. (gh-1668)Adds support for a new flag,
--subdir <path>
, forsemgrep ci
, which allows users to pass asubdirectory to scan instead of the entire directory. The path should be a relative path, and
the directory where
semgrep ci
is run should be the root of the repository being scanned.Unless
SEMGREP_REPO_DISPLAY_NAME
is explicitly set, passing the subdirectorywill cause the results to go to a project specific to that subdirectory.
The intended use case for
semgrep ci --subdir path/to/dir
is to help users with very largerepos scan the repo in parts. (saf-1056)
Fixed
Language Server will now send error messages properly, and error handling is greatly improved (cdx-502)
Pro: Calling a safe method on a tainted object should no longer propagate taint.
Example:
Fixing errors in matching identifiers from wildcard imports. For example, this
update addresses the issue where the following top-level assignment:
from pony.orm import *
db = Database()
is not matched with the following pattern:
$DB = pony.orm.Database(...)
``` (code-7045)
[Pro Interfile JS/TS] Improve taint propagation through callbacks passed to
$X.map
functions and similar. Previously, such callbacks needed to have a return value for taint to be properly tracked. After this fix, they do not. (js-taint)Rust: Constructors will now properly match to only other constructors with
the same names, in patterns. (saf-1099)
v1.75.0
Compare Source
Added
Pro: Semgrep can now track taint through tuple/list (un)packing intra-procedurally
(i.e., within a single function). For example:
Optional type matching is supported in the Pro engine for Python. For example,
in Python,
Optional[str]
,str | None
, andUnion[str, None]
represent thesame type but in different type expressions. The optional type match support
enables matching between these expressions, allowing any optional type
expression to match any other optional type expression when used with
metavariable-type filtering. It's important to note that syntactic pattern
matching still distinguishes between these types. (code-6939)
Add support for pnpm v9 (pnpm)
Added a new rule option decorators_order_matters, which allows users to make decorators/ non-keyword attributes matching stricter. The default matching for attributes is order-agnostic, but if this rule option is set to true, non-keyword attributes (e.g. decorators in Python) will be matched in order, while keyword attributes (e.g. static, inline, etc) are not affected.
An example usage will be a rule to detect any decorator that is outside of the route() decorator in Flask, since any decorator outside of the route() decorator takes no effect.
v1.74.0
Compare Source
Fixed
One part of interfile tainting was missing a constant propagation phase, which causes semgrep to miss some true positives in some cases during interfile analysis.
This fix adds the missing constant propagation. (saf-1032)
Semgrep now matches YAML tags (e.g.
!number
in!number 42
) correctly ratherthan ignoring them. (saf-1046)
Upgraded Semgrep's Dockerfile parser. This brings in various
fixes from
tree-sitter-dockerfile
including minimal support for heredoc templates, support for variables in keys
of LABEL instructions, support for multiple parameters for ADD and COPY
instructions, tolerance for blanks after the backslash of a line continuation.
As a result of supporting variables in LABEL keys, the multiple key/value
pairs found in LABEL instructions are now treated as if they each had they own
LABEL instruction. It allows a pattern
LABEL a=b
to matchLABEL a=b c=d
without the need for an ellipsis (
LABEL a=b ...
). Another consequence isthat the pattern
LABEL a=b c=d
can no longer matchLABEL c=d a=b
but itwill match a
LABEL a=b
instruction immediately followed by a separateLABEL c=d
. (upgrade-dockerfile-parser)v1.73.0
Compare Source
Added
Fixed
couldn't find metavar $MT in the match results
error, which may occurwhen we capture FQN with the metavariable and use metavariable-type filter on
it. (code-7042)
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.