File tree Expand file tree Collapse file tree 3 files changed +50
-0
lines changed
docs/codeql/support/reusables
python/ql/lib/semmle/python Expand file tree Collapse file tree 3 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -204,4 +204,5 @@ Python built-in support
204
204
pycryptodomex, Cryptography library
205
205
rsa, Cryptography library
206
206
MarkupSafe, Escaping Library
207
+ libxml2, XML processing library
207
208
lxml, XML processing library
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ private import semmle.python.frameworks.FlaskSqlAlchemy
22
22
private import semmle.python.frameworks.Idna
23
23
private import semmle.python.frameworks.Invoke
24
24
private import semmle.python.frameworks.Jmespath
25
+ private import semmle.python.frameworks.Libxml2
25
26
private import semmle.python.frameworks.Lxml
26
27
private import semmle.python.frameworks.MarkupSafe
27
28
private import semmle.python.frameworks.Multidict
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Provides classes modeling security-relevant aspects of the `libxml2` PyPI package.
3
+ *
4
+ * See
5
+ * - https://pypi.org/project/libxml2-python3/
6
+ * - http://xmlsoft.org/python.html
7
+ */
8
+
9
+ private import python
10
+ private import semmle.python.dataflow.new.DataFlow
11
+ private import semmle.python.Concepts
12
+ private import semmle.python.ApiGraphs
13
+
14
+ /**
15
+ * Provides classes modeling security-relevant aspects of the `libxml2` PyPI package
16
+ *
17
+ * See
18
+ * - https://pypi.org/project/libxml2-python3/
19
+ * - http://xmlsoft.org/python.html
20
+ */
21
+ private module Libxml2 {
22
+ /**
23
+ * A call to the `xpathEval` method of a parsed document.
24
+ *
25
+ * import libxml2
26
+ * tree = libxml2.parseFile("file.xml")
27
+ * r = tree.xpathEval('`sink`')
28
+ *
29
+ * See http://xmlsoft.org/python.html
30
+ */
31
+ class XpathEvalCall extends XPathExecution:: Range , DataFlow:: CallCfgNode {
32
+ XpathEvalCall ( ) {
33
+ this =
34
+ API:: moduleImport ( "libxml2" )
35
+ .getMember ( "parseFile" )
36
+ .getReturn ( )
37
+ .getMember ( "xpathEval" )
38
+ .getACall ( )
39
+ }
40
+
41
+ override DataFlow:: Node getXPath ( ) { result = this .getArg ( 0 ) }
42
+
43
+ // TODO: implement when we get call nodes
44
+ override DataFlow:: Node getTree ( ) { none ( ) }
45
+
46
+ override string getName ( ) { result = "libxml2" }
47
+ }
48
+ }
You can’t perform that action at this time.
0 commit comments