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

Update dependency semgrep to v1.78.0 #97

Merged
merged 1 commit into from
Jul 9, 2024
Merged

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented May 16, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
semgrep ==1.72.0 -> ==1.78.0 age adoption passing confidence

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:

    from a.b import C
    
    x = C()
    

    The type of x will match both a.b.C and C.

      - pattern: $X = $Y()
      - metavariable-type:
          metavariable: $X
          types:
            - a.b.C  # or C
    ``` (code-7269)
    
Fixed
  • Symbolic propagation now works on decorator functions, for example:

    x = foo
    @​x() # this is now matched by pattern `@foo()`
    def test():
      pass (code-6634)
    
  • Fixed an issue where Python functions with annotations ending in endpoint,
    route, get, patch, post, put, delete, before_request or
    after_request (i.e., ones we associate with Flask) were incorrectly analyzed
    with 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:

     def foo():
         return ("ok", taint)
    
     def test():
          x, y = foo()
          sink(x)  # nothing, no FP
          sink(y)  # finding
    

    Example 2:

     def foo(t):
          (x, y) = t
          sink(x)  # nothing, no FP
          sink(y)  # finding
    
     def test():
          foo(("ok", taint)) (code-6935)
    
  • Adds traces to help debug the performance of tainting. To send the traces added in the PR, pass
    --trace and also set the environment variable SEMGREP_TRACE_LEVEL=trace. To send them to a
    local 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 that
    could e.g. cause taint to report false positives:

    def test():
        data = taint
        try:
    

Semgrep assumes that clean could raise an exception, but

even if it does, the tainted data will never reach the sink !

          data = clean(data)
      except Exception:
          raise Exception()

data must be clean here

      sink(data) # no more FP (flow-78)
  • The language server (and semgrep --experimental) should not report anymore errors from
    the metrics.semgrep.dev server such as "cannot read property 'map' of undefined". (metrics_error)
  • Fixed a bug in the gemfile.lock parser which causes Semgrep to miss direct
    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
    +, -, *, /, >, >=, <=, <, ==, !=, and not. For numeric
    computation operators such as + and -, if the left-hand side and right-hand
    side types are equal, the return type is assumed to be the same. Additionally,
    comparison operators like > and ==, as well as the negation operator not,
    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>, for semgrep ci, which allows users to pass a
    subdirectory 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 subdirectory
    will 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 large
    repos 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:

    class A {
        String foo(String str) {
            return "ok";
        }
    }
    
    class Test {
        public static void test() {
            A a;
            String s;
            a = taint();
            // Despite `a` is tainted, `a.foo()` is entirely safe !!!
            s = a.foo("bar");
            sink(s); // No more FP here
        }
    } (code-6935)
    
  • 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:

    t = ["ok", "taint"]
    x, y = t
    sink(x) # OK, no finding
    sink(y) # tainted, finding
    ``` (code-6935)
  • Optional type matching is supported in the Pro engine for Python. For example,
    in Python, Optional[str], str | None, and Union[str, None] represent the
    same 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 rather
    than 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 match LABEL a=b c=d
    without the need for an ellipsis (LABEL a=b ...). Another consequence is
    that the pattern LABEL a=b c=d can no longer match LABEL c=d a=b but it
    will match a LABEL a=b instruction immediately followed by a separate
    LABEL c=d. (upgrade-dockerfile-parser)

v1.73.0

Compare Source

Added
  • Added new AWS validator syntax for Secrets (scrt-278)
Fixed
  • Fix couldn't find metavar $MT in the match results error, which may occur
    when we capture FQN with the metavariable and use metavariable-type filter on
    it. (code-7042)
  • Fixes the crash (during scan) caused by improper handling of unicode characters present in the source code. (gh-8421)
  • [Pro Engine Only] Tainted values are now tracked through instantiation of React functional components via JSX. (jsx-taint)

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.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot changed the title Update dependency semgrep to v1.73.0 Update dependency semgrep to v1.74.0 May 23, 2024
@renovate renovate bot force-pushed the renovate/semgrep-1.x branch 2 times, most recently from df5faa9 to 419b699 Compare May 27, 2024 20:33
@renovate renovate bot changed the title Update dependency semgrep to v1.74.0 Update dependency semgrep to v1.75.0 Jun 3, 2024
@renovate renovate bot force-pushed the renovate/semgrep-1.x branch from 419b699 to 045f23e Compare June 3, 2024 17:09
@renovate renovate bot force-pushed the renovate/semgrep-1.x branch from 045f23e to 60fcf64 Compare June 17, 2024 16:22
@renovate renovate bot changed the title Update dependency semgrep to v1.75.0 Update dependency semgrep to v1.76.0 Jun 17, 2024
@renovate renovate bot force-pushed the renovate/semgrep-1.x branch from 60fcf64 to 4db9353 Compare June 24, 2024 21:18
@renovate renovate bot changed the title Update dependency semgrep to v1.76.0 Update dependency semgrep to v1.77.0 Jun 24, 2024
@renovate renovate bot force-pushed the renovate/semgrep-1.x branch from 4db9353 to a7c3204 Compare June 28, 2024 01:08
@renovate renovate bot changed the title Update dependency semgrep to v1.77.0 Update dependency semgrep to v1.78.0 Jun 28, 2024
@renovate renovate bot force-pushed the renovate/semgrep-1.x branch from a7c3204 to 938820b Compare July 7, 2024 00:46
@renovate renovate bot changed the base branch from main to dev July 7, 2024 00:46
@renovate renovate bot force-pushed the renovate/semgrep-1.x branch 2 times, most recently from 65a2df7 to e0eb9e1 Compare July 7, 2024 23:54
@renovate renovate bot force-pushed the renovate/semgrep-1.x branch from e0eb9e1 to 86a76ce Compare July 7, 2024 23:55
@jontyms jontyms merged commit 39c44f4 into dev Jul 9, 2024
6 checks passed
@renovate renovate bot deleted the renovate/semgrep-1.x branch July 9, 2024 20:28
jontyms pushed a commit that referenced this pull request Jul 29, 2024
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant