Skip to content

Commit cac5d00

Browse files
committed
Python: Fix string taint tests
The tests in ql/python/ql/test/library-tests/taint/strings/ shows that ClassValue::str() is not good enough.
1 parent 2416cac commit cac5d00

File tree

1 file changed

+5
-7
lines changed
  • python/ql/src/semmle/python/security/strings

1 file changed

+5
-7
lines changed

python/ql/src/semmle/python/security/strings/Basic.qll

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,11 @@ private predicate encode_decode(ControlFlowNode fromnode, CallNode tonode) {
9494
/* tonode = str(fromnode)*/
9595
private predicate to_str(ControlFlowNode fromnode, CallNode tonode) {
9696
tonode.getAnArg() = fromnode and
97-
tonode = ClassValue::str().getACall()
98-
// TODO: should it instead be this?
99-
// (
100-
// tonode = ClassValue::bytes().getACall()
101-
// or
102-
// tonode = ClassValue::unicode().getACall()
103-
// )
97+
(
98+
tonode = ClassValue::bytes().getACall()
99+
or
100+
tonode = ClassValue::unicode().getACall()
101+
)
104102
}
105103

106104
/* tonode = fromnode[:] */

0 commit comments

Comments
 (0)