Giter Site home page Giter Site logo

semgrep_interpackage_test's Introduction

Introduction.

This folder contains two go package, and the packagea/test.go invoke functions from packagea and packageb.

The rule.yaml is written to detected data flow from input to output.

To test the rule on the code, I run the command:

semgrep --pro --config=./rule.yaml .

However, it does not able to detect the dataflow pattern that across the two packages.

 packagea/test.go
    ❯❱ test_inter_analysis
          message: test_inter analysis.

           25┆ fmt.Println("Output:", output)


          Taint comes from:

           16┆ input, _ := reader.ReadString('\n')


          Taint flows through these intermediate variables:

           16┆ input, _ := reader.ReadString('\n')

           19┆ output := processInput(input)

           29┆ func processInput(input string) string {

           19┆ output := processInput(input)


                This is how taint reaches the sink:

           25┆ fmt.Println("Output:", output)


            ⋮┆----------------------------------------
           31┆ fmt.Println("Output:", input)


          Taint comes from:

           16┆ input, _ := reader.ReadString('\n')


          Taint flows through these intermediate variables:

           16┆ input, _ := reader.ReadString('\n')


                This is how taint reaches the sink:

           19┆ output := processInput(input)

          Taint flows through these intermediate variables:

           29┆ func processInput(input string) string {

          then reaches:

           31┆ fmt.Println("Output:", input)




┌──────────────┐
│ Scan Summary │
└──────────────┘
Some files were skipped or only partially analyzed.
  Scan was limited to files tracked by git.

Ran 1 rule on 3 files: 2 findings.

semgrep_interpackage_test's People

Contributors

zhilongwang avatar

Watchers

 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.