Skip to content

Commit a879041

Browse files
committed
add support for the Argument[any] and Argument[any-named] tokens
1 parent b1fa7f8 commit a879041

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

python/ql/lib/semmle/python/frameworks/data/internal/ApiGraphModelsSpecific.qll

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,19 @@ API::Node getExtraSuccessorFromInvoke(API::CallNode node, AccessPathToken token)
9292
token.getName() = "Instance" and
9393
result = node.getReturn()
9494
or
95-
token.getName() = "Argument" and
96-
token.getAnArgument() = "self" and
97-
result = node.getSelfParameter()
98-
or
99-
token.getName() = "Argument" and
100-
exists(string arg | arg + ":" = token.getAnArgument() | result = node.getKeywordParameter(arg))
95+
token.getName() = ["Argument", "Parameter"] and
96+
(
97+
token.getAnArgument() = "self" and
98+
result = node.getSelfParameter()
99+
or
100+
token.getAnArgument() = "any" and
101+
result = [node.getParameter(_), node.getKeywordParameter(_)]
102+
or
103+
token.getAnArgument() = "any-named" and
104+
result = node.getKeywordParameter(_)
105+
or
106+
exists(string arg | arg + ":" = token.getAnArgument() | result = node.getKeywordParameter(arg))
107+
)
101108
}
102109

103110
/**

python/ql/test/library-tests/frameworks/data/test.ql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ class Sinks extends ModelInput::SinkModelCsv {
5858
}
5959
}
6060

61-
// TODO: Any argument
62-
// TODO: Test taint steps.
61+
// TODO: Test taint steps (include that the base path may end with ".Call")
6362
// TODO: // There are no API-graph edges for: ArrayElement, Element, MapKey, MapValue (remove from valid tokens list)
6463
class Sources extends ModelInput::SourceModelCsv {
6564
// package;type;path;kind

0 commit comments

Comments
 (0)