PyCQA / PyCQA/bandit

Create a control flow graph to traverse code in possible execution order

Open
#1,197 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
8.3k
Forks
836
Avg merge
5d 3h
Merged PRs (30d)
1

Description

Is your feature request related to a problem? Please describe.
Bandit could really benefit from a Control Flow Graph to do things like taint analysis and analysis based on possible execution order.

Describe the solution you'd like
There is an existing Python package staticfg that might be useful to generate the CFG. From the CFG bandit can traverse the generated graph instead of the AST.

Describe alternatives you've considered
Current behavior does analysis top-down in the file, which is almost never the execution of the program making things like taint analysis next to impossible.

Additional context
https://github.com/coetaur0/staticfg

Love this idea? Give it a 👍. We prioritize fulfilling features with the most 👍.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing Bandit's current top-down AST analysis and the staticfg package linked in the issue. Define how a control flow graph would support traversal in possible execution order and enable the stated taint-analysis goal; completion would require an agreed integration design and implementation scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.