Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Javascript] Resolve property injection in Taint-Tracking ? #20498

Unanswered
KHANHD192 asked this question in Q&A
Discussion options

📌 Initial Context

I have a Node.js project with the following structure:

categories/index.js

const Categories = {};
require('./search')(Categories);
module.exports = Categories;

search.js

module.exports = function (Categories) {
 Categories.search = function (arg) {
 // implementation here
 };
};

main.js

const categories = require('../categories');
categories.search("payload");

📌 The Problem with CodeQL Analysis

I want to write a TaintTracking query in CodeQL to track data from
categories.search("payload") in main.js into the actual implementation of the function defined in search.js.

However, by default, CodeQL does not automatically connect through these steps:

require('../categories') → the Categories object from index.js.

require('./search')(Categories) → the parameter Categories inside search.js.

Categories.search = function(...) { ... } → linking the .search property to the function body.

As a result, when running taint tracking, the flow always stops at the callsite categories.search("payload") and never enters the function body.

📌 Question

👉 How can I write an AdditionalTaintStep (or the proper configuration) so that CodeQL can understand .
The taint flow can propagate from the callsite categories.search("...") in main.js all the way into the body of the function defined in search.js.

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

Can you show the code for the query that you're working on?

You must be logged in to vote
1 reply
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants

AltStyle によって変換されたページ (->オリジナル) /