pypi semgrep 1.52.0
Release v1.52.0

latest releases: 1.89.0, 1.88.0, 1.87.0...
9 months ago

1.52.0 - 2023-12-05

Added

  • Java: Semgrep will now recognize String.format(...) expressions as constant
    strings when all their arguments are constant, but it will still not know
    what exact string it is. For example, code String.format("Abc %s", "123")
    will match pattern "..." but it will not match pattern "Abc 123". (pa-3284)

Changed

  • Inter-file diff scan will be gradually introduced to a small percentage of
    users through a slow rollout process. Users who enable the pro engine and
    engage in differential PR scans on Github or Gitlab may experience the impact
    of this update. (ea-268)
  • secrets: now performs more aggressive deduplication for instances where an
    invalid and valid match are reported at the same range. Instead of reporting
    both, we now report only the valid match when they are otherwise visually
    identical. (scrt-271)

Fixed

  • In expression-based languages, definitions are also expressions.

    This change allows dataflow to properly handle definition expressions.

    For example, the pattern 0 == 0 will match x == 0 in

    def f(c) do
      x = (y = 0)
      x == 0
    end

    because now dataflow is able to handle the expression y = 0. (pa-3262)

  • In version 1.14.0 (pa-2477) we made sink-matching more precise when the sink
    specification was like:

    pattern-sinks:
      - patterns:
         - pattern: sink($X, ...)
         - focus-metavariable: $X

    Where the sink specification most likely has the intent to specify the first
    argument of sink as a sink, and sink(ok1 if tainted else ok2) should NOT
    produce a finding, because tainted is not really what is being passed to
    the sink function.

    But we only intercepted the most simple pattern above, and more complex sink
    specifications that had the same intent were not properly recognized.

    Now we have generalized that pattern to cover more complex cases like:

    patterns:
     - pattern-either:
       - patterns:
         - pattern-inside: |
             def foo(...):
               ...
         - pattern: sink1($X)
       - patterns:
         - pattern: sink2($X)
         - pattern-not: bar(...)
     - focus-metavariable: $X
    ``` (pa-3284)
  • Updated the parser used for Rust (rust)

Don't miss a new semgrep release

NewReleases is sending notifications on new releases.