Skip to main content

Python

Vulkro finds the HTTP endpoints in a Python project, traces request data to dangerous sinks and checks PyPI dependencies against the local CVE bundle.

vulkro scan .
vulkro discover . # endpoint map only

What is analysed​

AreaCoverage
FrameworksFastAPI, Flask, Django, Django REST Framework, Django Ninja, Starlette, aiohttp, Tornado, Litestar
Other surfacesGraphQL (Strawberry, graphene), gRPC, Starlette WebSockets
Route compositionFastAPI include_router(prefix=...), Flask Blueprint(url_prefix=...) and Django urls.py include trees, so paths match what the server serves
Access modelEach endpoint gets an auth tier, scopes and tenant scoping, used by the OWASP API Top 10 checks
Taint sourcesflask.request.*, Django request.GET / request.POST, FastAPI request.json() / request.form() / request.query_params, handler parameters
Taint sinkscursor.execute / engine.execute / session.execute without binding, subprocess.run(shell=True), eval, pickle.loads, yaml.load(..., Loader=yaml.Loader), requests.get(...) (SSRF), redirect(...)
Dependenciesrequirements*.txt, Pipfile, pyproject.toml, with exact versions from poetry.lock and Pipfile.lock, matched against the local CVE bundle. See Dependencies and CVEs

Each taint finding carries the source-to-sink hop chain. See Taint analysis.

Example finding​

@app.route("/users")
def get_user():
name = request.args.get("name")
cur = sqlite3.connect("app.db").cursor()
cur.execute("SELECT * FROM users WHERE name = '" + name + "'")
CRITICAL Tainted request value reaches SQL execute() without parameter binding or allowlist
Source: `flask:request` on parameter `name` of `get_user`.
CWE-89 SQL injection · proven (admitted)
app.py:11
Fix: cursor.execute("SELECT * FROM t WHERE id = %s", (param,))
id: py-taint-sql-001:...

Run vulkro explain PY-TAINT-SQL-001 for the full guidance.