Skip to content

Commit a1aa16f

Browse files
authored
Merge pull request github#13745 from GeekMasher/py-mad-xss
Python - Add Models as Data support for Reflected XSS Query
2 parents 1deacf4 + 6ef55aa commit a1aa16f

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* Add support for Models as Data for Reflected XSS query

python/ql/lib/semmle/python/security/dataflow/ReflectedXSSCustomizations.qll

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
private import python
88
private import semmle.python.dataflow.new.DataFlow
99
private import semmle.python.Concepts
10+
private import semmle.python.frameworks.data.ModelsAsData
1011
private import semmle.python.dataflow.new.RemoteFlowSources
1112
private import semmle.python.dataflow.new.BarrierGuards
1213

@@ -43,6 +44,15 @@ module ReflectedXss {
4344
*/
4445
class RemoteFlowSourceAsSource extends Source, RemoteFlowSource { }
4546

47+
/**
48+
* A data flow sink for "reflected cross-site scripting" vulnerabilities.
49+
*/
50+
private class SinkFromModel extends Sink {
51+
SinkFromModel() {
52+
this = ModelOutput::getASinkNode(["html-injection", "js-injection"]).asSink()
53+
}
54+
}
55+
4656
/**
4757
* The body of a HTTP response that will be returned from a server, considered as a flow sink.
4858
*/

0 commit comments

Comments
 (0)