Skip to content

feat: FastAPI and CLI precision - #59

Merged
SizzleUnrlsd merged 2 commits into
mainfrom
feat/fastapi-cli-precision
Sep 4, 2026
Merged

SizzleUnrlsd merged 2 commits into
mainfrom
feat/fastapi-cli-precision

Conversation

@SizzleUnrlsd

Copy link
Copy Markdown
Contributor

Summary

Findings from four new repositories under tests-project/: Vulnerable_fastapi (six documented vulnerabilities in report/REPORT.md), InsecureGram (eleven in its README), DjangoGoat on its broken branch, and yt-fts, a real click command-line tool. Each fix is traced to a line they exposed.

  • Tests first (test: define FastAPI, SQL position, deserialization, redirect and CLI behaviour), implementation follows.
  • A method on what a project function returns resolves through its summary even when the call graph already derived a project symbol for it: get_conn().execute(...) in another file was app.database.get_conn.execute, unknown to the models, and hid the FastAPI login injection.
  • Sink.positions: SQL sinks read the statement only, so a tainted value in the parameter tuple of a parameterised query is not an injection, while the credential kind keeps every argument. Without it the fix above would have flagged every parameterised query of Vulnerable_fastapi.
  • An annotated parameter denotes its class in the call graph, so db: Session = Depends(get_db) gives db.execute its sink and sqlalchemy.text is a sink whose result carries no further SQL taint: InsecureGram's search injection.
  • Two new taint kinds with sinks and detectors: DESERIALIZATION (pickle, marshal, shelve, dill, jsonpickle, unsafe yaml loaders; insecure-deserialization, critical) and REDIRECT (Flask, Werkzeug, Django, FastAPI and Starlette redirects; open-redirect, medium). Existing expectations built on yaml.load(input()) gain the deserialization finding.
  • Command-line entry points: click.command, click.group, the commands of a group and of a Typer application make their parameters argv input; a module-level function decorated by a symbol is an instance of that symbol, so @cli.command() resolves. argv input carries every kind but PATH, a tool being expected to open the paths it is given; sys.argv follows.

On the four repositories: the FastAPI login injection and the guarded download traversal of Vulnerable_fastapi; the injection, deserialization, redirect, command execution, SSRF and upload of InsecureGram; two guarded redirects in DjangoGoat; nothing wrong in yt-fts. Still missing from their ground truth: Django views registered in urls.py and Model.objects.raw, next pass; template XSS, IDOR and CSRF, outside static analysis of Python.

@SizzleUnrlsd SizzleUnrlsd self-assigned this Sep 4, 2026
@SizzleUnrlsd
SizzleUnrlsd merged commit 9fea00d into main Sep 4, 2026
6 checks passed
@SizzleUnrlsd
SizzleUnrlsd deleted the feat/fastapi-cli-precision branch September 4, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant