Compare commits

..

38 Commits

Author SHA1 Message Date
Esben Sparre Andreasen
794eb1c551 disabled new features 2022-04-25 09:04:56 +02:00
Stephan Brandauer
179eac0485 add functionInterfacesInFile and surroundingFunctionParameters features 2022-04-25 09:04:56 +02:00
Stephan Brandauer
d05d72001e documentation for calleeImports ATM feature 2022-04-25 09:04:56 +02:00
Stephan Brandauer
688af3b3b3 ATM: new feature to list all imports that are used in a callee 2022-04-25 09:04:56 +02:00
Stephan Brandauer
81dd1810a6 documentation for new feature 2022-04-25 09:04:56 +02:00
Stephan Brandauer
16538a8a36 ATM: new feature to list all imports in an endpoint's file 2022-04-25 09:04:56 +02:00
Esben Sparre Andreasen
4585028f75 add docstring examples 2022-04-25 09:04:56 +02:00
Esben Sparre Andreasen
b6fe0fb016 address review comments 2022-04-25 09:04:56 +02:00
Esben Sparre Andreasen
b39f4fdc9d Apply suggestions from code review
Co-authored-by: Henry Mercer <henrymercer@github.com>
2022-04-25 09:04:56 +02:00
Esben Sparre Andreasen
ad57b60d59 fix semantic merge conflict 2022-04-25 09:04:56 +02:00
Esben Sparre Andreasen
60eb6a68c1 rename new features 2022-04-25 09:04:56 +02:00
Esben Sparre Andreasen
1d0f9a5328 add more features 2022-04-25 09:04:56 +02:00
Esben Sparre Andreasen
d8d7673b21 improve feature documentation 2022-04-25 09:04:56 +02:00
Esben Sparre Andreasen
24559af34a improve feature tests with more cases 2022-04-25 09:04:56 +02:00
Esben Sparre Andreasen
bb6201e1b5 improve access path strings 2022-04-25 09:04:56 +02:00
Esben Sparre Andreasen
397c6b0826 support import in getSimpleAccessPath 2022-04-25 09:04:56 +02:00
Esben Sparre Andreasen
19ac1b6e57 support await in getSimpleAccessPath 2022-04-25 09:04:56 +02:00
Esben Sparre Andreasen
1efb91c272 avoid using new feautes by default 2022-04-25 09:04:56 +02:00
Esben Sparre Andreasen
76762be83b add CompareFeatures.ql 2022-04-25 09:04:56 +02:00
Esben Sparre Andreasen
bffa9bae1d add generic tests for features 2022-04-25 09:04:56 +02:00
Esben Sparre Andreasen
45275b57dc Document EndpointFeatures.qll 2022-04-25 09:04:56 +02:00
Esben Sparre Andreasen
103295688e add ParameterAccessPathSimpleFromArgumentTraversal 2022-04-25 09:04:56 +02:00
Esben Sparre Andreasen
886662de8d improve getSimpleAccessPath 2022-04-25 09:04:55 +02:00
Esben Sparre Andreasen
7e614487b9 refactor calleeAccessPath feature to class 2022-04-25 09:04:55 +02:00
Stephan Brandauer
483c67e582 refactor getACallBasedTokenFeature to class-use 2022-04-25 09:04:55 +02:00
Esben Sparre Andreasen
e2ab7e9c09 Add CalleeAccessPathSimpleFromArgumentTraversal 2022-04-25 09:04:55 +02:00
Esben Sparre Andreasen
b3252bcfc3 refactor EndpointFeatures.ql to use classes 2022-04-25 09:04:55 +02:00
Jeroen Ketema
a4711206c8 Merge pull request #8769 from felickz/patch-1
Docs - Supported Queries - Fixing broken link
2022-04-22 18:29:27 +02:00
Mathias Vorreiter Pedersen
1e61fdde8b Merge pull request #8815 from jketema/unreachable-test-case
C++: Add non-returning function test case using `__builtin_expect`
2022-04-22 16:47:44 +01:00
Jeroen Ketema
97d4a12fb2 C++: Add non-returning function test case using __builtin_expect 2022-04-22 17:10:54 +02:00
Robert Marsh
ebdf553621 Merge pull request #8806 from dbartol/dbartol/typedefs/work
C++: Work around missing size for typedef
2022-04-22 10:09:24 -04:00
Rasmus Wriedt Larsen
3e8274ede8 Merge pull request #8812 from RasmusWL/stdlib-FileSystemAccess-improvement
Python: Minor Stdlib file system access improvement
2022-04-22 16:06:41 +02:00
Rasmus Wriedt Larsen
03c0366fd4 Merge branch 'main' into stdlib-FileSystemAccess-improvement 2022-04-22 14:31:31 +02:00
Rasmus Wriedt Larsen
650d57083b Python: Recognize path arguments to pathlib methods 2022-04-22 11:01:59 +02:00
Rasmus Wriedt Larsen
bcaba45202 Python: Expand pathlib tests 2022-04-22 11:01:59 +02:00
Rasmus Wriedt Larsen
059dea713d Python: Fix os.path.samefile modeling 2022-04-22 11:01:59 +02:00
Dave Bartolomeo
83fdff54c4 Work around missing size for typedef
See #8805 for the underlying issue. The symptom was bad IR generation on a large number of functions because we never generated an `IRVariable` for a parameter with the affected type.
2022-04-21 16:16:09 -04:00
Chad Bentz
990b7a29e8 Docs - Supported Queries - Fixing broken link
update link target
2022-04-18 10:30:24 -04:00
9 changed files with 501 additions and 140 deletions

View File

@@ -141,7 +141,7 @@ private predicate isOpaqueType(Type type) {
* Holds if an `IROpaqueType` with the specified `tag` and `byteSize` should exist.
*/
predicate hasOpaqueType(Type tag, int byteSize) {
isOpaqueType(tag) and byteSize = getTypeSize(tag)
isOpaqueType(tag) and byteSize = getTypeSize(tag.getUnspecifiedType())
or
tag instanceof UnknownType and Raw::needsUnknownOpaqueType(byteSize)
}
@@ -153,17 +153,18 @@ private IRType getIRTypeForPRValue(Type type) {
exists(Type unspecifiedType | unspecifiedType = type.getUnspecifiedType() |
isOpaqueType(unspecifiedType) and
exists(IROpaqueType opaqueType | opaqueType = result |
opaqueType.getByteSize() = getTypeSize(type) and
opaqueType.getByteSize() = getTypeSize(unspecifiedType) and
opaqueType.getTag() = unspecifiedType
)
or
unspecifiedType instanceof BoolType and result.(IRBooleanType).getByteSize() = type.getSize()
unspecifiedType instanceof BoolType and
result.(IRBooleanType).getByteSize() = unspecifiedType.getSize()
or
isSignedIntegerType(unspecifiedType) and
result.(IRSignedIntegerType).getByteSize() = type.getSize()
result.(IRSignedIntegerType).getByteSize() = unspecifiedType.getSize()
or
isUnsignedIntegerType(unspecifiedType) and
result.(IRUnsignedIntegerType).getByteSize() = type.getSize()
result.(IRUnsignedIntegerType).getByteSize() = unspecifiedType.getSize()
or
exists(FloatingPointType floatType, IRFloatingPointType irFloatType |
floatType = unspecifiedType and
@@ -173,7 +174,8 @@ private IRType getIRTypeForPRValue(Type type) {
irFloatType.getDomain() = floatType.getDomain()
)
or
isPointerIshType(unspecifiedType) and result.(IRAddressType).getByteSize() = getTypeSize(type)
isPointerIshType(unspecifiedType) and
result.(IRAddressType).getByteSize() = getTypeSize(unspecifiedType)
or
unspecifiedType instanceof FunctionPointerIshType and
result.(IRFunctionAddressType).getByteSize() = getTypeSize(type)

View File

@@ -105,3 +105,8 @@ _Noreturn void f15();
int f16() {
f15(); // GOOD
}
int f17() {
if (__builtin_expect(1, 0))
__builtin_unreachable(); // GOOD
}

View File

@@ -27,7 +27,7 @@ The process must begin with the first step and must conclude with the final step
Add one or more unit tests for the query (and for any library changes you make) to the `ql/<language>/ql/test/experimental` directory. Tests for library changes go into the `library-tests` subdirectory, and tests for queries go into `query-tests` with their relative path mirroring the query's location under `ql/<language>/ql/src/experimental`.
- See the section on [Testing custom queries](https://help.semmle.com/codeql/codeql-cli/procedures/test-queries.html) in the [CodeQL documentation](https://codeql.github.com/docs/) for more information.
- See the section on [Testing custom queries](https://codeql.github.com/docs/codeql-cli/testing-custom-queries/) in the [CodeQL documentation](https://codeql.github.com/docs/) for more information.
- See [C/C++ CodeQL tests](/cpp/ql/test/README.md) for more information about contributing tests for C/C++ queries in particular.
4. **Test for correctness on real-world code**

View File

@@ -17,7 +17,22 @@ private string getTokenFeature(DataFlow::Node endpoint, string featureName) {
// Performance optimization: Restrict feature extraction to endpoints we've explicitly asked to featurize.
endpoint = any(FeaturizationConfig cfg).getAnEndpointToFeaturize() and
exists(EndpointFeature f | f.getName() = featureName and result = f.getValue(endpoint)) and
featureName = getASupportedFeatureName()
isVettedFeature(featureName)
}
predicate isVettedFeature(string featureName) {
// allowlist of vetted features that are permitted in production
featureName =
any(EndpointFeature f |
f instanceof EnclosingFunctionName or
f instanceof CalleeName or
f instanceof ReceiverName or
f instanceof ArgumentIndex or
f instanceof CalleeApiName or
f instanceof CalleeAccessPath or
f instanceof CalleeAccessPathWithStructuralInfo or
f instanceof EnclosingFunctionBody
).getName()
}
/**
@@ -202,11 +217,7 @@ string getASupportedFeatureName() {
f instanceof CalleeApiName or
f instanceof CalleeAccessPath or
f instanceof CalleeAccessPathWithStructuralInfo or
f instanceof EnclosingFunctionBody or
f instanceof Callee_AccessPath or
f instanceof Input_ArgumentIndexAndAccessPathFromCallee or
f instanceof Input_AccessPathFromCallee or
f instanceof Input_ArgumentIndex
f instanceof EnclosingFunctionBody
).getName()
}
@@ -223,7 +234,7 @@ predicate tokenFeatures(DataFlow::Node endpoint, string featureName, string feat
}
/**
* See EndpointFeauture
* See EndpointFeature
*/
private newtype TEndpointFeature =
TEnclosingFunctionName() or
@@ -234,10 +245,14 @@ private newtype TEndpointFeature =
TCalleeAccessPath() or
TCalleeAccessPathWithStructuralInfo() or
TEnclosingFunctionBody() or
TFileImports() or
TCalleeImports() or
TCallee_AccessPath() or
TInput_ArgumentIndexAndAccessPathFromCallee() or
TInput_AccessPathFromCallee() or
TInput_ArgumentIndex()
TInput_ArgumentIndex() or
TContextFunctionInterfacesInFile() or
TContextSurroundingFunctionParametersInFile()
/**
* An implementation of an endpoint feature: produces feature names and values for used in ML.
@@ -415,10 +430,164 @@ class EnclosingFunctionBody extends EndpointFeature, TEnclosingFunctionBody {
}
}
/**
*<<<<<<< HEAD
* The feature for the imports defined in the file containing an endpoint.
*
* ### Example
*
* ```javascript
* import { findOne } from 'mongoose';
* import * as _ from 'lodash';
* const pg = require('pg');
*
* // ...
* ```
*
* In this file, all endpoints will have the value `lodash mongoose pg` for the feature `fileImports`.
*/
class FileImports extends EndpointFeature, TFileImports {
override string getName() { result = "fileImports" }
override string getValue(DataFlow::Node endpoint) {
result =
concat(string importPath |
importPath = SyntacticUtilities::getImportPathForFile(endpoint.getFile())
|
importPath, " " order by importPath
)
}
}
/**
* The feature for the function parameters of the functions that enclose an endpoint.
*/
class ContextSurroundingFunctionParametersInFile extends EndpointFeature,
TContextSurroundingFunctionParametersInFile {
override string getName() { result = "contextSurroundingFunctionParametersInFile" }
Function getRelevantFunction(DataFlow::Node endpoint) {
result = endpoint.asExpr().getEnclosingFunction*()
}
override string getValue(DataFlow::Node endpoint) {
result =
concat(string functionParameterLine, Function f |
f = getRelevantFunction(endpoint) and
functionParameterLine = SyntacticUtilities::getFunctionParametersFeatureComponent(f)
|
functionParameterLine, "\n"
order by
f.getLocation().getStartLine(), f.getLocation().getStartColumn()
)
}
}
/**
*<<<<<<< HEAD
* The feature for the imports used in the callee of an invocation.
*
* ### Example
*
* ```javascript
* import * as _ from 'lodash';
*
* // ...
* _.deepClone(someObject);
* // ^^^^^^^^^^ will have the value `lodash` for the feature `calleeImports`.
* ```
*/
class CalleeImports extends EndpointFeature, TCalleeImports {
override string getName() { result = "calleeImports" }
override string getValue(DataFlow::Node endpoint) {
not result = SyntacticUtilities::getUnknownSymbol() and
exists(DataFlow::InvokeNode invk |
(
invk.getAnArgument() = endpoint or
SyntacticUtilities::getANestedInitializerValue(invk.getAnArgument()
.asExpr()
.getUnderlyingValue()).flow() = endpoint
) and
result =
concat(string importPath |
importPath = SyntacticUtilities::getCalleeImportPath(invk.getCalleeNode())
|
importPath, " " order by importPath
)
)
}
}
/*
* The feature for the interfaces of all named functions in the same file as the endpoint.
*/
class ContextFunctionInterfacesInFile extends EndpointFeature, TContextFunctionInterfacesInFile {
override string getName() { result = "contextFunctionInterfacesInFile" }
override string getValue(DataFlow::Node endpoint) {
result = SyntacticUtilities::getFunctionInterfacesForFile(endpoint.getFile())
}
}
/**
* Syntactic utilities for feature value computation.
*/
private module SyntacticUtilities {
/** Gets an import located in `file`. */
string getImportPathForFile(File file) {
result = any(Import imp | imp.getFile() = file).getImportedPath().getValue()
}
/**
* Gets the feature component for the parameters of a function.
*
* ```javascript
* function f(a, b, c) { // will return "(a, b, c)" for this function
* return a + b + c;
* }
*
* async function g(a) { // will return "(a)" for this function
* return 2*a
* };
*
* const h = (b) => 3*b; // will return "(b)" for this function
* ```
*/
string getFunctionParametersFeatureComponent(Function f) {
result =
"(" +
concat(string parameter, int i |
parameter = f.getParameter(i).getName()
|
parameter, ", " order by i
) + ")"
}
/**
* Gets the function interfaces of all named functions in a file, concatenated together.
*
* ```javascript
* // Will return: "f(a, b, c)\ng(x, y, z)\nh(u, v)" for this file.
* function f(a, b, c) { ... }
*
* function g(x, y, z) {
* function h(u, v) { ... }
* ...
* }
*/
string getFunctionInterfacesForFile(File file) {
result =
concat(Function func, string line |
func.getFile() = file and
exists(func.getName()) and
line = func.getName() + getFunctionParametersFeatureComponent(func)
|
line, "\n" order by line
)
}
/**
* Gets a property initializer value in a an object literal or one of its nested object literals.
*/
@@ -461,6 +630,31 @@ private module SyntacticUtilities {
else result = getUnknownSymbol()
}
/**
* Gets the imported package path that this node depends on, if any.
*
* Otherwise, returns '?'.
*
* XXX Be careful with using this in your features, as it might teach the model
* a fixed list of "dangerous" libraries that could lead to bad generalization.
*/
string getCalleeImportPath(DataFlow::Node node) {
exists(DataFlow::Node src | src = node.getALocalSource() |
if src instanceof DataFlow::ModuleImportNode
then result = src.(DataFlow::ModuleImportNode).getPath()
else
if src instanceof DataFlow::PropRead
then result = getCalleeImportPath(src.(DataFlow::PropRead).getBase())
else
if src instanceof DataFlow::InvokeNode
then result = getCalleeImportPath(src.(DataFlow::InvokeNode).getCalleeNode())
else
if src.asExpr() instanceof AwaitExpr
then result = getCalleeImportPath(src.asExpr().(AwaitExpr).getOperand().flow())
else result = getUnknownSymbol()
)
}
/**
* Computes a simple access path for a node.
*

View File

@@ -5,123 +5,202 @@
| test.html:2:61:2:68 | endpoint | calleeAccessPath | |
| test.html:2:61:2:68 | endpoint | calleeAccessPathWithStructuralInfo | |
| test.html:2:61:2:68 | endpoint | calleeName | item |
| test.js:2:7:2:14 | endpoint | Callee_AccessPath | f |
| test.js:2:7:2:14 | endpoint | Input_ArgumentIndex | 0 |
| test.js:2:7:2:14 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
| test.js:2:7:2:14 | endpoint | argumentIndex | 0 |
| test.js:2:7:2:14 | endpoint | calleeAccessPath | |
| test.js:2:7:2:14 | endpoint | calleeAccessPathWithStructuralInfo | |
| test.js:2:7:2:14 | endpoint | calleeName | f |
| test.js:2:7:2:14 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint |
| test.js:2:7:2:14 | endpoint | enclosingFunctionName | |
| test.js:3:11:3:18 | endpoint | Callee_AccessPath | f |
| test.js:3:11:3:18 | endpoint | Input_AccessPathFromCallee | 0.p |
| test.js:3:11:3:18 | endpoint | Input_ArgumentIndex | 0 |
| test.js:3:11:3:18 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0.p |
| test.js:3:11:3:18 | endpoint | calleeAccessPath | |
| test.js:3:11:3:18 | endpoint | calleeAccessPathWithStructuralInfo | |
| test.js:3:11:3:18 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint |
| test.js:3:11:3:18 | endpoint | enclosingFunctionName | |
| test.js:4:15:4:22 | endpoint | Callee_AccessPath | f |
| test.js:4:15:4:22 | endpoint | Input_AccessPathFromCallee | 0.p.q |
| test.js:4:15:4:22 | endpoint | Input_ArgumentIndex | 0 |
| test.js:4:15:4:22 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0.p.q |
| test.js:4:15:4:22 | endpoint | calleeAccessPath | |
| test.js:4:15:4:22 | endpoint | calleeAccessPathWithStructuralInfo | |
| test.js:4:15:4:22 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint |
| test.js:4:15:4:22 | endpoint | enclosingFunctionName | |
| test.js:5:9:5:16 | endpoint | Callee_AccessPath | o.m |
| test.js:5:9:5:16 | endpoint | Input_ArgumentIndex | 0 |
| test.js:5:9:5:16 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
| test.js:5:9:5:16 | endpoint | argumentIndex | 0 |
| test.js:5:9:5:16 | endpoint | calleeAccessPath | |
| test.js:5:9:5:16 | endpoint | calleeAccessPathWithStructuralInfo | |
| test.js:5:9:5:16 | endpoint | calleeName | m |
| test.js:5:9:5:16 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint |
| test.js:5:9:5:16 | endpoint | enclosingFunctionName | |
| test.js:5:9:5:16 | endpoint | receiverName | o |
| test.js:6:13:6:20 | endpoint | Callee_AccessPath | o.m |
| test.js:6:13:6:20 | endpoint | Input_AccessPathFromCallee | 0.p |
| test.js:6:13:6:20 | endpoint | Input_ArgumentIndex | 0 |
| test.js:6:13:6:20 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0.p |
| test.js:6:13:6:20 | endpoint | calleeAccessPath | |
| test.js:6:13:6:20 | endpoint | calleeAccessPathWithStructuralInfo | |
| test.js:6:13:6:20 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint |
| test.js:6:13:6:20 | endpoint | enclosingFunctionName | |
| test.js:7:17:7:24 | endpoint | Callee_AccessPath | o.m |
| test.js:7:17:7:24 | endpoint | Input_AccessPathFromCallee | 0.p.q |
| test.js:7:17:7:24 | endpoint | Input_ArgumentIndex | 0 |
| test.js:7:17:7:24 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0.p.q |
| test.js:7:17:7:24 | endpoint | calleeAccessPath | |
| test.js:7:17:7:24 | endpoint | calleeAccessPathWithStructuralInfo | |
| test.js:7:17:7:24 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint |
| test.js:7:17:7:24 | endpoint | enclosingFunctionName | |
| test.js:8:11:8:18 | endpoint | Callee_AccessPath | F |
| test.js:8:11:8:18 | endpoint | Input_ArgumentIndex | 0 |
| test.js:8:11:8:18 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | ? |
| test.js:8:11:8:18 | endpoint | calleeAccessPath | |
| test.js:8:11:8:18 | endpoint | calleeAccessPathWithStructuralInfo | |
| test.js:8:11:8:18 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint |
| test.js:8:11:8:18 | endpoint | enclosingFunctionName | |
| test.js:9:17:9:24 | endpoint | Callee_AccessPath | o.m().m().m |
| test.js:9:17:9:24 | endpoint | Input_ArgumentIndex | 0 |
| test.js:9:17:9:24 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
| test.js:9:17:9:24 | endpoint | argumentIndex | 0 |
| test.js:9:17:9:24 | endpoint | calleeAccessPath | |
| test.js:9:17:9:24 | endpoint | calleeAccessPathWithStructuralInfo | |
| test.js:9:17:9:24 | endpoint | calleeName | m |
| test.js:9:17:9:24 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint |
| test.js:9:17:9:24 | endpoint | enclosingFunctionName | |
| test.js:10:9:10:16 | endpoint | Callee_AccessPath | f() |
| test.js:10:9:10:16 | endpoint | Input_ArgumentIndex | 0 |
| test.js:10:9:10:16 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
| test.js:10:9:10:16 | endpoint | argumentIndex | 0 |
| test.js:10:9:10:16 | endpoint | calleeAccessPath | |
| test.js:10:9:10:16 | endpoint | calleeAccessPathWithStructuralInfo | |
| test.js:10:9:10:16 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint |
| test.js:10:9:10:16 | endpoint | enclosingFunctionName | |
| test.js:11:12:11:19 | endpoint | Callee_AccessPath | o.?.m |
| test.js:11:12:11:19 | endpoint | Input_ArgumentIndex | 0 |
| test.js:11:12:11:19 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
| test.js:11:12:11:19 | endpoint | argumentIndex | 0 |
| test.js:11:12:11:19 | endpoint | calleeAccessPath | |
| test.js:11:12:11:19 | endpoint | calleeAccessPathWithStructuralInfo | |
| test.js:11:12:11:19 | endpoint | calleeName | m |
| test.js:11:12:11:19 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint |
| test.js:11:12:11:19 | endpoint | enclosingFunctionName | |
| test.js:12:16:12:23 | endpoint | Callee_AccessPath | o.m.?.p.m |
| test.js:12:16:12:23 | endpoint | Input_ArgumentIndex | 0 |
| test.js:12:16:12:23 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
| test.js:12:16:12:23 | endpoint | argumentIndex | 0 |
| test.js:12:16:12:23 | endpoint | calleeAccessPath | |
| test.js:12:16:12:23 | endpoint | calleeAccessPathWithStructuralInfo | |
| test.js:12:16:12:23 | endpoint | calleeName | m |
| test.js:12:16:12:23 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint |
| test.js:12:16:12:23 | endpoint | enclosingFunctionName | |
| test.js:13:15:13:22 | endpoint | Callee_AccessPath | (await p) |
| test.js:13:15:13:22 | endpoint | Input_ArgumentIndex | 0 |
| test.js:13:15:13:22 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
| test.js:13:15:13:22 | endpoint | argumentIndex | 0 |
| test.js:13:15:13:22 | endpoint | calleeAccessPath | |
| test.js:13:15:13:22 | endpoint | calleeAccessPathWithStructuralInfo | |
| test.js:13:15:13:22 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint |
| test.js:13:15:13:22 | endpoint | enclosingFunctionName | |
| test.js:14:27:14:34 | endpoint | Callee_AccessPath | import(!).bar.baz |
| test.js:14:27:14:34 | endpoint | Input_ArgumentIndex | 0 |
| test.js:14:27:14:34 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
| test.js:14:27:14:34 | endpoint | argumentIndex | 0 |
| test.js:14:27:14:34 | endpoint | calleeAccessPath | foo bar baz |
| test.js:14:27:14:34 | endpoint | calleeAccessPathWithStructuralInfo | foo member bar member baz instanceorreturn |
| test.js:14:27:14:34 | endpoint | calleeApiName | foo |
| test.js:14:27:14:34 | endpoint | calleeName | baz |
| test.js:14:27:14:34 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint |
| test.js:14:27:14:34 | endpoint | enclosingFunctionName | |
| test.js:16:13:16:20 | endpoint | Callee_AccessPath | bar |
| test.js:16:13:16:20 | endpoint | Input_ArgumentIndex | 0 |
| test.js:16:13:16:20 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
| test.js:16:13:16:20 | endpoint | argumentIndex | 0 |
| test.js:16:13:16:20 | endpoint | calleeAccessPath | |
| test.js:16:13:16:20 | endpoint | calleeAccessPathWithStructuralInfo | |
| test.js:16:13:16:20 | endpoint | calleeName | bar |
| test.js:16:13:16:20 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint |
| test.js:16:13:16:20 | endpoint | enclosingFunctionName | |
| test.html:2:61:2:68 | endpoint | contextFunctionInterfacesInFile | |
| test.html:2:61:2:68 | endpoint | contextSurroundingFunctionParametersInFile | |
| test.html:2:61:2:68 | endpoint | fileImports | |
| test.js:6:7:6:14 | endpoint | Callee_AccessPath | f |
| test.js:6:7:6:14 | endpoint | Input_ArgumentIndex | 0 |
| test.js:6:7:6:14 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
| test.js:6:7:6:14 | endpoint | argumentIndex | 0 |
| test.js:6:7:6:14 | endpoint | calleeAccessPath | lib3 |
| test.js:6:7:6:14 | endpoint | calleeAccessPathWithStructuralInfo | lib3 instanceorreturn |
| test.js:6:7:6:14 | endpoint | calleeApiName | lib3 |
| test.js:6:7:6:14 | endpoint | calleeImports | ? lib3 |
| test.js:6:7:6:14 | endpoint | calleeName | f |
| test.js:6:7:6:14 | endpoint | contextFunctionInterfacesInFile | f(endpoint)\nfoo()\ng()\nm() |
| test.js:6:7:6:14 | endpoint | contextSurroundingFunctionParametersInFile | () |
| test.js:6:7:6:14 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint f f o m endpoint |
| test.js:6:7:6:14 | endpoint | enclosingFunctionName | |
| test.js:6:7:6:14 | endpoint | fileImports | foo lib1 lib2 lib3 |
| test.js:7:11:7:18 | endpoint | Callee_AccessPath | f |
| test.js:7:11:7:18 | endpoint | Input_AccessPathFromCallee | 0.p |
| test.js:7:11:7:18 | endpoint | Input_ArgumentIndex | 0 |
| test.js:7:11:7:18 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0.p |
| test.js:7:11:7:18 | endpoint | calleeAccessPath | |
| test.js:7:11:7:18 | endpoint | calleeAccessPathWithStructuralInfo | |
| test.js:7:11:7:18 | endpoint | calleeImports | ? lib3 |
| test.js:7:11:7:18 | endpoint | contextFunctionInterfacesInFile | f(endpoint)\nfoo()\ng()\nm() |
| test.js:7:11:7:18 | endpoint | contextSurroundingFunctionParametersInFile | () |
| test.js:7:11:7:18 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint f f o m endpoint |
| test.js:7:11:7:18 | endpoint | enclosingFunctionName | |
| test.js:7:11:7:18 | endpoint | fileImports | foo lib1 lib2 lib3 |
| test.js:8:15:8:22 | endpoint | Callee_AccessPath | f |
| test.js:8:15:8:22 | endpoint | Input_AccessPathFromCallee | 0.p.q |
| test.js:8:15:8:22 | endpoint | Input_ArgumentIndex | 0 |
| test.js:8:15:8:22 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0.p.q |
| test.js:8:15:8:22 | endpoint | calleeAccessPath | |
| test.js:8:15:8:22 | endpoint | calleeAccessPathWithStructuralInfo | |
| test.js:8:15:8:22 | endpoint | calleeImports | ? lib3 |
| test.js:8:15:8:22 | endpoint | contextFunctionInterfacesInFile | f(endpoint)\nfoo()\ng()\nm() |
| test.js:8:15:8:22 | endpoint | contextSurroundingFunctionParametersInFile | () |
| test.js:8:15:8:22 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint f f o m endpoint |
| test.js:8:15:8:22 | endpoint | enclosingFunctionName | |
| test.js:8:15:8:22 | endpoint | fileImports | foo lib1 lib2 lib3 |
| test.js:9:9:9:16 | endpoint | Callee_AccessPath | o.m |
| test.js:9:9:9:16 | endpoint | Input_ArgumentIndex | 0 |
| test.js:9:9:9:16 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
| test.js:9:9:9:16 | endpoint | argumentIndex | 0 |
| test.js:9:9:9:16 | endpoint | calleeAccessPath | lib2 m |
| test.js:9:9:9:16 | endpoint | calleeAccessPathWithStructuralInfo | lib2 member m instanceorreturn |
| test.js:9:9:9:16 | endpoint | calleeApiName | lib2 |
| test.js:9:9:9:16 | endpoint | calleeImports | ? lib2 |
| test.js:9:9:9:16 | endpoint | calleeName | m |
| test.js:9:9:9:16 | endpoint | contextFunctionInterfacesInFile | f(endpoint)\nfoo()\ng()\nm() |
| test.js:9:9:9:16 | endpoint | contextSurroundingFunctionParametersInFile | () |
| test.js:9:9:9:16 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint f f o m endpoint |
| test.js:9:9:9:16 | endpoint | enclosingFunctionName | |
| test.js:9:9:9:16 | endpoint | fileImports | foo lib1 lib2 lib3 |
| test.js:9:9:9:16 | endpoint | receiverName | o |
| test.js:10:13:10:20 | endpoint | Callee_AccessPath | o.m |
| test.js:10:13:10:20 | endpoint | Input_AccessPathFromCallee | 0.p |
| test.js:10:13:10:20 | endpoint | Input_ArgumentIndex | 0 |
| test.js:10:13:10:20 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0.p |
| test.js:10:13:10:20 | endpoint | calleeAccessPath | |
| test.js:10:13:10:20 | endpoint | calleeAccessPathWithStructuralInfo | |
| test.js:10:13:10:20 | endpoint | calleeImports | ? lib2 |
| test.js:10:13:10:20 | endpoint | contextFunctionInterfacesInFile | f(endpoint)\nfoo()\ng()\nm() |
| test.js:10:13:10:20 | endpoint | contextSurroundingFunctionParametersInFile | () |
| test.js:10:13:10:20 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint f f o m endpoint |
| test.js:10:13:10:20 | endpoint | enclosingFunctionName | |
| test.js:10:13:10:20 | endpoint | fileImports | foo lib1 lib2 lib3 |
| test.js:11:17:11:24 | endpoint | Callee_AccessPath | o.m |
| test.js:11:17:11:24 | endpoint | Input_AccessPathFromCallee | 0.p.q |
| test.js:11:17:11:24 | endpoint | Input_ArgumentIndex | 0 |
| test.js:11:17:11:24 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0.p.q |
| test.js:11:17:11:24 | endpoint | calleeAccessPath | |
| test.js:11:17:11:24 | endpoint | calleeAccessPathWithStructuralInfo | |
| test.js:11:17:11:24 | endpoint | calleeImports | ? lib2 |
| test.js:11:17:11:24 | endpoint | contextFunctionInterfacesInFile | f(endpoint)\nfoo()\ng()\nm() |
| test.js:11:17:11:24 | endpoint | contextSurroundingFunctionParametersInFile | () |
| test.js:11:17:11:24 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint f f o m endpoint |
| test.js:11:17:11:24 | endpoint | enclosingFunctionName | |
| test.js:11:17:11:24 | endpoint | fileImports | foo lib1 lib2 lib3 |
| test.js:12:11:12:18 | endpoint | Callee_AccessPath | F |
| test.js:12:11:12:18 | endpoint | Input_ArgumentIndex | 0 |
| test.js:12:11:12:18 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | ? |
| test.js:12:11:12:18 | endpoint | calleeAccessPath | |
| test.js:12:11:12:18 | endpoint | calleeAccessPathWithStructuralInfo | |
| test.js:12:11:12:18 | endpoint | calleeImports | lib1 |
| test.js:12:11:12:18 | endpoint | contextFunctionInterfacesInFile | f(endpoint)\nfoo()\ng()\nm() |
| test.js:12:11:12:18 | endpoint | contextSurroundingFunctionParametersInFile | () |
| test.js:12:11:12:18 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint f f o m endpoint |
| test.js:12:11:12:18 | endpoint | enclosingFunctionName | |
| test.js:12:11:12:18 | endpoint | fileImports | foo lib1 lib2 lib3 |
| test.js:13:17:13:24 | endpoint | Callee_AccessPath | o.m().m().m |
| test.js:13:17:13:24 | endpoint | Input_ArgumentIndex | 0 |
| test.js:13:17:13:24 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
| test.js:13:17:13:24 | endpoint | argumentIndex | 0 |
| test.js:13:17:13:24 | endpoint | calleeAccessPath | lib2 m m m |
| test.js:13:17:13:24 | endpoint | calleeAccessPathWithStructuralInfo | lib2 member m instanceorreturn member m instanceorreturn member m instanceorreturn |
| test.js:13:17:13:24 | endpoint | calleeApiName | lib2 |
| test.js:13:17:13:24 | endpoint | calleeImports | ? lib2 |
| test.js:13:17:13:24 | endpoint | calleeName | m |
| test.js:13:17:13:24 | endpoint | contextFunctionInterfacesInFile | f(endpoint)\nfoo()\ng()\nm() |
| test.js:13:17:13:24 | endpoint | contextSurroundingFunctionParametersInFile | () |
| test.js:13:17:13:24 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint f f o m endpoint |
| test.js:13:17:13:24 | endpoint | enclosingFunctionName | |
| test.js:13:17:13:24 | endpoint | fileImports | foo lib1 lib2 lib3 |
| test.js:14:9:14:16 | endpoint | Callee_AccessPath | f() |
| test.js:14:9:14:16 | endpoint | Input_ArgumentIndex | 0 |
| test.js:14:9:14:16 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
| test.js:14:9:14:16 | endpoint | argumentIndex | 0 |
| test.js:14:9:14:16 | endpoint | calleeAccessPath | lib3 |
| test.js:14:9:14:16 | endpoint | calleeAccessPathWithStructuralInfo | lib3 instanceorreturn instanceorreturn |
| test.js:14:9:14:16 | endpoint | calleeApiName | lib3 |
| test.js:14:9:14:16 | endpoint | calleeImports | ? lib3 |
| test.js:14:9:14:16 | endpoint | contextFunctionInterfacesInFile | f(endpoint)\nfoo()\ng()\nm() |
| test.js:14:9:14:16 | endpoint | contextSurroundingFunctionParametersInFile | () |
| test.js:14:9:14:16 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint f f o m endpoint |
| test.js:14:9:14:16 | endpoint | enclosingFunctionName | |
| test.js:14:9:14:16 | endpoint | fileImports | foo lib1 lib2 lib3 |
| test.js:15:12:15:19 | endpoint | Callee_AccessPath | o.?.m |
| test.js:15:12:15:19 | endpoint | Input_ArgumentIndex | 0 |
| test.js:15:12:15:19 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
| test.js:15:12:15:19 | endpoint | argumentIndex | 0 |
| test.js:15:12:15:19 | endpoint | calleeAccessPath | lib2 m |
| test.js:15:12:15:19 | endpoint | calleeAccessPathWithStructuralInfo | lib2 member member m instanceorreturn |
| test.js:15:12:15:19 | endpoint | calleeApiName | lib2 |
| test.js:15:12:15:19 | endpoint | calleeImports | ? lib2 |
| test.js:15:12:15:19 | endpoint | calleeName | m |
| test.js:15:12:15:19 | endpoint | contextFunctionInterfacesInFile | f(endpoint)\nfoo()\ng()\nm() |
| test.js:15:12:15:19 | endpoint | contextSurroundingFunctionParametersInFile | () |
| test.js:15:12:15:19 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint f f o m endpoint |
| test.js:15:12:15:19 | endpoint | enclosingFunctionName | |
| test.js:15:12:15:19 | endpoint | fileImports | foo lib1 lib2 lib3 |
| test.js:16:16:16:23 | endpoint | Callee_AccessPath | o.m.?.p.m |
| test.js:16:16:16:23 | endpoint | Input_ArgumentIndex | 0 |
| test.js:16:16:16:23 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
| test.js:16:16:16:23 | endpoint | argumentIndex | 0 |
| test.js:16:16:16:23 | endpoint | calleeAccessPath | lib2 m p m |
| test.js:16:16:16:23 | endpoint | calleeAccessPathWithStructuralInfo | lib2 member m member member p member m instanceorreturn |
| test.js:16:16:16:23 | endpoint | calleeApiName | lib2 |
| test.js:16:16:16:23 | endpoint | calleeImports | ? lib2 |
| test.js:16:16:16:23 | endpoint | calleeName | m |
| test.js:16:16:16:23 | endpoint | contextFunctionInterfacesInFile | f(endpoint)\nfoo()\ng()\nm() |
| test.js:16:16:16:23 | endpoint | contextSurroundingFunctionParametersInFile | () |
| test.js:16:16:16:23 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint f f o m endpoint |
| test.js:16:16:16:23 | endpoint | enclosingFunctionName | |
| test.js:16:16:16:23 | endpoint | fileImports | foo lib1 lib2 lib3 |
| test.js:17:15:17:22 | endpoint | Callee_AccessPath | (await p) |
| test.js:17:15:17:22 | endpoint | Input_ArgumentIndex | 0 |
| test.js:17:15:17:22 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
| test.js:17:15:17:22 | endpoint | argumentIndex | 0 |
| test.js:17:15:17:22 | endpoint | calleeAccessPath | lib1 p |
| test.js:17:15:17:22 | endpoint | calleeAccessPathWithStructuralInfo | lib1 member p instanceorreturn |
| test.js:17:15:17:22 | endpoint | calleeApiName | lib1 |
| test.js:17:15:17:22 | endpoint | calleeImports | lib1 |
| test.js:17:15:17:22 | endpoint | contextFunctionInterfacesInFile | f(endpoint)\nfoo()\ng()\nm() |
| test.js:17:15:17:22 | endpoint | contextSurroundingFunctionParametersInFile | () |
| test.js:17:15:17:22 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint f f o m endpoint |
| test.js:17:15:17:22 | endpoint | enclosingFunctionName | |
| test.js:17:15:17:22 | endpoint | fileImports | foo lib1 lib2 lib3 |
| test.js:18:27:18:34 | endpoint | Callee_AccessPath | import(!).bar.baz |
| test.js:18:27:18:34 | endpoint | Input_ArgumentIndex | 0 |
| test.js:18:27:18:34 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
| test.js:18:27:18:34 | endpoint | argumentIndex | 0 |
| test.js:18:27:18:34 | endpoint | calleeAccessPath | foo bar baz |
| test.js:18:27:18:34 | endpoint | calleeAccessPathWithStructuralInfo | foo member bar member baz instanceorreturn |
| test.js:18:27:18:34 | endpoint | calleeApiName | foo |
| test.js:18:27:18:34 | endpoint | calleeImports | foo |
| test.js:18:27:18:34 | endpoint | calleeName | baz |
| test.js:18:27:18:34 | endpoint | contextFunctionInterfacesInFile | f(endpoint)\nfoo()\ng()\nm() |
| test.js:18:27:18:34 | endpoint | contextSurroundingFunctionParametersInFile | () |
| test.js:18:27:18:34 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint f f o m endpoint |
| test.js:18:27:18:34 | endpoint | enclosingFunctionName | |
| test.js:18:27:18:34 | endpoint | fileImports | foo lib1 lib2 lib3 |
| test.js:20:13:20:20 | endpoint | Callee_AccessPath | bar |
| test.js:20:13:20:20 | endpoint | Input_ArgumentIndex | 0 |
| test.js:20:13:20:20 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
| test.js:20:13:20:20 | endpoint | argumentIndex | 0 |
| test.js:20:13:20:20 | endpoint | calleeAccessPath | lib1 bar |
| test.js:20:13:20:20 | endpoint | calleeAccessPathWithStructuralInfo | lib1 member bar instanceorreturn |
| test.js:20:13:20:20 | endpoint | calleeApiName | lib1 |
| test.js:20:13:20:20 | endpoint | calleeImports | lib1 |
| test.js:20:13:20:20 | endpoint | calleeName | bar |
| test.js:20:13:20:20 | endpoint | contextFunctionInterfacesInFile | f(endpoint)\nfoo()\ng()\nm() |
| test.js:20:13:20:20 | endpoint | contextSurroundingFunctionParametersInFile | () |
| test.js:20:13:20:20 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint f f o m endpoint |
| test.js:20:13:20:20 | endpoint | enclosingFunctionName | |
| test.js:20:13:20:20 | endpoint | fileImports | foo lib1 lib2 lib3 |
| test.js:22:21:22:28 | endpoint | Input_ArgumentIndex | 0 |
| test.js:22:21:22:28 | endpoint | Input_ArgumentIndexAndAccessPathFromCallee | 0 |
| test.js:22:21:22:28 | endpoint | argumentIndex | 0 |
| test.js:22:21:22:28 | endpoint | calleeAccessPath | lib3 |
| test.js:22:21:22:28 | endpoint | calleeAccessPathWithStructuralInfo | lib3 instanceorreturn |
| test.js:22:21:22:28 | endpoint | calleeApiName | lib3 |
| test.js:22:21:22:28 | endpoint | calleeImports | ? lib2 lib3 |
| test.js:22:21:22:28 | endpoint | contextFunctionInterfacesInFile | f(endpoint)\nfoo()\ng()\nm() |
| test.js:22:21:22:28 | endpoint | contextSurroundingFunctionParametersInFile | () |
| test.js:22:21:22:28 | endpoint | enclosingFunctionBody | f endpoint f p endpoint f p q endpoint o m endpoint o m p endpoint o m p q endpoint F endpoint o m m m endpoint f endpoint o x m endpoint o m x p m endpoint p endpoint foo bar baz endpoint foo bar endpoint f f o m endpoint |
| test.js:22:21:22:28 | endpoint | enclosingFunctionName | |
| test.js:22:21:22:28 | endpoint | fileImports | foo lib1 lib2 lib3 |

View File

@@ -1,4 +1,8 @@
(async function(){
import { bar, F, p } from 'lib1';
import * as o from 'lib2';
const f = require('lib3');
(async function () {
f(endpoint);
f({p: endpoint});
f({p: {q: endpoint}});
@@ -15,4 +19,11 @@
function foo() {
bar(endpoint);
}
});
(f() ? f : o.m)(endpoint);
});
function f(endpoint) {}
const g = async () => undefined;
const o = { m: () => undefined }

View File

@@ -959,13 +959,18 @@ private module StdlibPrivate {
}
}
/** A call to `os.path.samefile` will raise an exception if an `os.stat()` call on either pathname fails. */
/**
* A call to `os.path.samefile` will raise an exception if an `os.stat()` call on either pathname fails.
*
* See https://docs.python.org/3.10/library/os.path.html#os.path.samefile
*/
private class OsPathSamefileCall extends FileSystemAccess::Range, DataFlow::CallCfgNode {
OsPathSamefileCall() { this = OS::path().getMember("samefile").getACall() }
override DataFlow::Node getAPathArgument() {
result in [
this.getArg(0), this.getArgByName("path1"), this.getArg(1), this.getArgByName("path2")
// note that the f1/f2 names doesn't match the documentation, but is what actually works (tested on 3.8.10)
this.getArg(0), this.getArgByName("f1"), this.getArg(1), this.getArgByName("f2")
]
}
}
@@ -2534,6 +2539,56 @@ private module StdlibPrivate {
PathLibOpenCall() { attrbuteName = "open" }
}
/**
* A call to the `link_to`, `hardlink_to`, or `symlink_to` method on a `pathlib.Path` instance.
*
* See
* - https://docs.python.org/3/library/pathlib.html#pathlib.Path.link_to
* - https://docs.python.org/3/library/pathlib.html#pathlib.Path.hardlink_to
* - https://docs.python.org/3/library/pathlib.html#pathlib.Path.symlink_to
*/
private class PathLibLinkToCall extends PathlibFileAccess, API::CallNode {
PathLibLinkToCall() { attrbuteName in ["link_to", "hardlink_to", "symlink_to"] }
override DataFlow::Node getAPathArgument() {
result = super.getAPathArgument()
or
result = this.getParameter(0, "target").getARhs()
}
}
/**
* A call to the `replace` or `rename` method on a `pathlib.Path` instance.
*
* See
* - https://docs.python.org/3/library/pathlib.html#pathlib.Path.replace
* - https://docs.python.org/3/library/pathlib.html#pathlib.Path.rename
*/
private class PathLibReplaceCall extends PathlibFileAccess, API::CallNode {
PathLibReplaceCall() { attrbuteName in ["replace", "rename"] }
override DataFlow::Node getAPathArgument() {
result = super.getAPathArgument()
or
result = this.getParameter(0, "target").getARhs()
}
}
/**
* A call to the `samefile` method on a `pathlib.Path` instance.
*
* See https://docs.python.org/3/library/pathlib.html#pathlib.Path.samefile
*/
private class PathLibSameFileCall extends PathlibFileAccess, API::CallNode {
PathLibSameFileCall() { attrbuteName = "samefile" }
override DataFlow::Node getAPathArgument() {
result = super.getAPathArgument()
or
result = this.getParameter(0, "other_path").getARhs()
}
}
/** An additional taint steps for objects of type `pathlib.Path` */
private class PathlibPathTaintStep extends TaintTracking::AdditionalTaintStep {
override predicate step(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) {

View File

@@ -21,3 +21,15 @@ o(name) # $ getAPathArgument=name
wb = p.write_bytes
wb(b"hello") # $ getAPathArgument=p fileWriteData=b"hello"
p.link_to("target") # $ getAPathArgument=p getAPathArgument="target"
p.link_to(target="target") # $ getAPathArgument=p getAPathArgument="target"
p.samefile("other_path") # $ getAPathArgument=p getAPathArgument="other_path"
p.samefile(other_path="other_path") # $ getAPathArgument=p getAPathArgument="other_path"
p.rename("target") # $ getAPathArgument=p getAPathArgument="target"
p.rename(target="target") # $ getAPathArgument=p getAPathArgument="target"
p.replace("target") # $ getAPathArgument=p getAPathArgument="target"
p.replace(target="target") # $ getAPathArgument=p getAPathArgument="target"

View File

@@ -48,6 +48,9 @@ os.path.islink(path="path") # $ getAPathArgument="path"
os.path.ismount("path") # $ getAPathArgument="path"
os.path.ismount(path="path") # $ getAPathArgument="path"
os.path.samefile("f1", "f2") # $ getAPathArgument="f1" getAPathArgument="f2"
os.path.samefile(f1="f1", f2="f2") # $ getAPathArgument="f1" getAPathArgument="f2"
# actual os.path implementations
import posixpath
import ntpath
@@ -269,4 +272,4 @@ shutil.copystat("src", "dst") # $ getAPathArgument="src" getAPathArgument="dst"
shutil.copystat(src="src", dst="dst") # $ getAPathArgument="src" getAPathArgument="dst"
shutil.disk_usage("path") # $ getAPathArgument="path"
shutil.disk_usage(path="path") # $ getAPathArgument="path"
shutil.disk_usage(path="path") # $ getAPathArgument="path"