Javascript - Figure out whether CallExpr refers to function defined in external file #18719
Replies: 3 comments
-
Hi @DSimsek000 , Thanks for your question. I've asked the CodeQL JavaScript team to take a look. |
Beta Was this translation helpful? Give feedback.
0 replies
-
This is a difficult problem and not one that we provide a simple solution for. You can look at ExternalAPIUsedWithUntrustedDataCustomizations for an example of one way to deal with it. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I see, thanks for the reference! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to find calls to built-in APIs.
For the following query, I am looking for a query that returns 0, 1, 2:
I implemented the following query which gets all function names of the declarations in the external files and compares them with the name of the callee:
This however does not check the type and wrongly outputs 5 here:
Instead, I tried to retrieve references to the global builtin functions using the following query:
but that only shows the references in the file where it is declared.
How to resolve the calls to the actual declarations?
Beta Was this translation helpful? Give feedback.
All reactions