Skip to content

Commit 7535772

Browse files
authored
Merge pull request #4490 from RasmusWL/python-model-django-sources
Python: model Django HttpRequest as RemoteFlowSource
2 parents da58306 + b0af0b9 commit 7535772

File tree

28 files changed

+1092
-14
lines changed

28 files changed

+1092
-14
lines changed

python/ql/src/experimental/semmle/python/Concepts.qll

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,16 @@ module HTTP {
163163
* extend `RouteSetup` instead.
164164
*/
165165
abstract class Range extends DataFlow::Node {
166+
/** Gets the argument used to set the URL pattern. */
167+
abstract DataFlow::Node getUrlPatternArg();
168+
166169
/** Gets the URL pattern for this route, if it can be statically determined. */
167-
abstract string getUrlPattern();
170+
string getUrlPattern() {
171+
exists(StrConst str |
172+
DataFlow::localFlow(DataFlow::exprNode(str), this.getUrlPatternArg()) and
173+
result = str.getText()
174+
)
175+
}
168176

169177
/** Gets a function that will handle incoming requests for this route, if any. */
170178
abstract Function getARouteHandler();

0 commit comments

Comments
 (0)