Repository navigation
feat: Django and HTTP client models - #44
Merged
Merged
Conversation
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The two frameworks left open on #30, done as model plugins plus two small, generic engine mechanisms.
test: define Django and HTTP client model behavior), implementation follows.Parameter.annotationin the PyHIR: kept when the annotation is an expression the HIR represents, dropped otherwise, so no file that parsed before fails now.TypedParametermodel: a parameter annotated with the model's class symbol is attacker-controlled. Annotations resolve through the symbol table, so aliases such ashttp.HttpRequestwork.EntryPointnow also applies to the methods of a class deriving from its symbol,selfexcluded.taint.engine.parameter_sourcesgathers the three origins (decorators, bases, annotations) into per-parameter sources;propagate_tainttakes 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/extraSQL sinks,mark_safe/HttpResponse/TemplateHTML sinks,FileResponsepath sink,escape/conditional_escapesanitizers. A barerequestparameter 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, onSession,ClientandAsyncClient, is a SSRF sink, and its result anhttp-responsesource, so data fetched from a remote server is untrusted downstream.Closes #30