Skip to content

Commit 27c368a

Browse files
committed
Python: Model keyword arguments to pickle.loads
1 parent 3592b09 commit 27c368a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ private module StdlibPrivate {
459459

460460
override predicate mayExecuteInput() { any() }
461461

462-
override DataFlow::Node getAnInput() { result = this.getArg(0) }
462+
override DataFlow::Node getAnInput() { result in [this.getArg(0), this.getArgByName("data")] }
463463

464464
override DataFlow::Node getOutput() { result = this }
465465

python/ql/test/library-tests/frameworks/stdlib/Decoding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
pickle.load(file=file_) # $ MISSING: decodeInput=file_ decodeOutput=pickle.load(..) decodeFormat=pickle decodeMayExecuteInput
88
pickle.loads(payload) # $ decodeInput=payload decodeOutput=pickle.loads(..) decodeFormat=pickle decodeMayExecuteInput
99
# using this keyword argument is disallowed from Python 3.9
10-
pickle.loads(data=payload) # $ decodeOutput=pickle.loads(..) decodeFormat=pickle decodeMayExecuteInput MISSING: decodeInput=payload
10+
pickle.loads(data=payload) # $ decodeInput=payload decodeOutput=pickle.loads(..) decodeFormat=pickle decodeMayExecuteInput
1111

1212
marshal.load(file_) # $ MISSING: decodeInput=file_ decodeOutput=marshal.load(..) decodeFormat=marshal decodeMayExecuteInput
1313
marshal.loads(payload) # $ decodeInput=payload decodeOutput=marshal.loads(..) decodeFormat=marshal decodeMayExecuteInput

0 commit comments

Comments
 (0)