Skip to content

Commit c004ffa

Browse files
committed
python: move model to Stdlib.yml
There is already a model there so we add to that one. We did observe that this existing model was blocked by the external MaD model. This is concerning and needs to be cleared up.
1 parent 281ac05 commit c004ffa

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

python/ql/lib/ext/StdLib.model.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ extensions:
3030
# See https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urljoin
3131
- ["urllib", "Member[parse].Member[urljoin]", "Argument[0,base:]", "ReturnValue", "taint"]
3232
- ["urllib", "Member[parse].Member[urljoin]", "Argument[1,url:]", "ReturnValue", "taint"]
33-
# See https://docs.python.org/3/library/re.html#re.compile
34-
- ["re", "Member[compile]", "Argument[0,pattern:]", "ReturnValue", "taint"]
3533
- addsTo:
3634
pack: codeql/python-all
3735
extensible: neutralModel

python/ql/lib/semmle/python/frameworks/Stdlib.qll

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3251,8 +3251,13 @@ module StdlibPrivate {
32513251

32523252
override predicate propagatesFlow(string input, string output, boolean preservesValue) {
32533253
input in ["Argument[0]", "Argument[pattern:]"] and
3254-
output = "ReturnValue.Attribute[pattern]" and
3255-
preservesValue = true
3254+
(
3255+
output = "ReturnValue.Attribute[pattern]" and
3256+
preservesValue = true
3257+
or
3258+
output = "ReturnValue" and
3259+
preservesValue = false
3260+
)
32563261
}
32573262
}
32583263

0 commit comments

Comments
 (0)