Dedac / codeql-javascript-unsafe-jquery-plugin

https://lab.github.com/githubtraining/codeql-for-javascript:-unsafe-jquery-plugin
1 stars 0 forks source link

Step 8 - Finding jQuery plugin options: final step #13

Closed github-learning-lab[bot] closed 3 years ago

github-learning-lab[bot] commented 3 years ago

Step 8: Finding the jQuery plugin options

Now we want to finally find the jQuery plugin options. These are the last parameter of the functions that we found in the previous step.

github-learning-lab[bot] commented 3 years ago

:keyboard: Write your query

Edit the file plugin-options.ql and copy there your previous query.

  1. Modify your from clause so that the variable that describes that jQuery plugin is of type DataFlow::FunctionNode. As the name suggests, this is a data flow node that refers to a function definition. By typing this variable with this type, your query will restrict the possible values for your plugin variable to this type only.
  2. Use auto-completion on that variable to browse the predicates of DataFlow::FunctionNode and find the one that will get you the last parameter of that function.
  3. Your return variable should be of type DataFlow::ParameterNode

Submit your query.

github-learning-lab[bot] commented 3 years ago

Ooops! The query you submitted in 74b25e674db0aab46ccbb36f7fad7038927d2808 didn't find the right results. Have a look at the comment.

To submit a new iteration of your query, you just have to push a new commit to the same branch (the default branch or the PR branch).

github-learning-lab[bot] commented 3 years ago

Ooops! The query you submitted in a8aa02daf811c97e3a93c244d7090fce9565e32f didn't find the right results. Have a look at the comment.

To submit a new iteration of your query, you just have to push a new commit to the same branch (the default branch or the PR branch).

github-learning-lab[bot] commented 3 years ago

Congratulations, looks like the query you introduced in 2b7e9f926104a897865f993b7c9513f3d5a66df8 finds the correct results!

Take a look at the instructions for the next step to continue.