Skip to content

feat: Django and HTTP client models - #44

Merged
SizzleUnrlsd merged 2 commits into
mainfrom
feat/django-requests
Sep 4, 2026
Merged

SizzleUnrlsd merged 2 commits into
mainfrom
feat/django-requests

Conversation

@SizzleUnrlsd

Copy link
Copy Markdown
Contributor

Summary

The two frameworks left open on #30, done as model plugins plus two small, generic engine mechanisms.

  • Acceptance tests first (test: define Django and HTTP client model behavior), implementation follows.
  • Parameter.annotation in the PyHIR: kept when the annotation is an expression the HIR represents, dropped otherwise, so no file that parsed before fails now.
  • TypedParameter model: a parameter annotated with the model's class symbol is attacker-controlled. Annotations resolve through the symbol table, so aliases such as http.HttpRequest work.
  • EntryPoint now also applies to the methods of a class deriving from its symbol, self excluded. taint.engine.parameter_sources gathers the three origins (decorators, bases, annotations) into per-parameter sources; propagate_taint takes that mapping instead of one entry point.
  • models/django: request classes as typed parameters (Django and Django REST framework), class-based view bases and view decorators as entry points, raw cursor, RawSQL, raw/extra SQL sinks, mark_safe/HttpResponse/Template HTML sinks, FileResponse path sink, escape/conditional_escape sanitizers. A bare request parameter without annotation, base or decorator is not recognised and URL configurations are not read; both are documented.
  • models/http_clients: every Requests and httpx request function, on the module, on Session, Client and AsyncClient, is a SSRF sink, and its result an http-response source, so data fetched from a remote server is untrusted downstream.
  • Detectors unchanged.

Closes #30

@SizzleUnrlsd SizzleUnrlsd mentioned this pull request Sep 4, 2026
6 tasks done
@SizzleUnrlsd SizzleUnrlsd self-assigned this Sep 4, 2026
@SizzleUnrlsd
SizzleUnrlsd merged commit d7acb28 into main Sep 4, 2026
6 checks passed
@SizzleUnrlsd
SizzleUnrlsd deleted the feat/django-requests branch September 4, 2026 00:42
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.

Add framework and library model plugins

1 participant