Code Monkey home page Code Monkey logo

python-interfile-example's Introduction

Python Example to show inter-file findings of Snyk Code

A simple example to show differences between Snyk Code findings and Bandit findings

How to

Make sure you install Snyk and Bandit installed

brew install snyk
pip install bandit

From the directory, to test for SAST vulns, run

# using Snyk
snyk code test

# using Bandit
bandit -r .

Interesting Test

On execer.py if we change foo to String 'foo' on line 5, then the Snyk Code results are much different.

Bandit has a medium severity finding of Use of exec with high confidence. Even though we use exec(), if the input from the request does not reach that function, then this is not a true Code Injection vulnerability.

If the unsanitized input does not flow to a sink, Snyk does not call it out as a vulnerability. Snyk is actually looking for an entire source to sink flow flow, which results in a lot less false positives.

Further, Snyk can do this analysis over separate files, which other static analysis tools have had limitations with.

python-interfile-example's People

Contributors

kriti-d avatar

Watchers

 avatar  avatar

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.