GithubHelp home page GithubHelp logo

Diff-aware doesn't report new findings if the new finding has the same (rule_id, path, line_of_code) as the one before about semgrep-action HOT 2 CLOSED

semgrep avatar semgrep commented on July 30, 2024
Diff-aware doesn't report new findings if the new finding has the same (rule_id, path, line_of_code) as the one before

from semgrep-action.

Comments (2)

Isaac0616 avatar Isaac0616 commented on July 30, 2024

Thinking it a bit more.
I think there are cases that even the Counter is not ideal.
For example:

- @web(skip_csrf_check=True)
def safe_endpoint(...):

+ @web(skip_csrf_check=True)
def sensitive_endpoint(...):

is bad but won't be flagged.
To solve it, I guess we have to check the actual changed lines between commits?

from semgrep-action.

nbrahms avatar nbrahms commented on July 30, 2024

I think we'd likely solve the 90% case by just incorporating the finding index on the file into the syntactic context.

Certainly to your point @Isaac0616 , we'd like to catch your case in the future, but we also want to avoid falsely flagging on simple refactors that touch unrelated code.

One idea we've bandied about in the past is to treat the previous and next lines as part of the syntactic context, although there are still possible false negatives in this case.

Another option would just be to make whether or not to include the line number as part of the syntactic context a configurable option, so you could choose your own noise.

from semgrep-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.