Skip to content

The strings were concatenated, making it impossible to match the path. #19479

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
fraudV opened this issue May 13, 2025 · 4 comments
Open

The strings were concatenated, making it impossible to match the path. #19479

fraudV opened this issue May 13, 2025 · 4 comments
Labels
question Further information is requested

Comments

@fraudV
Copy link

fraudV commented May 13, 2025

Source can query the fileName.
Image
Sink can also query data.
Image
Logic can be connected.
Image
But no results were found.
Image
The test from fileName to FileUtils.isValidFilename can retrieve results.
Image
However, when querying from fileName to writeBytes, no results are returned. The data passes through the line "String filePath = Global.getDownloadPath() + fileName;" in the middle.

Image

Image

@fraudV fraudV added the question Further information is requested label May 13, 2025
@redsun82
Copy link
Contributor

👋 @fraudV

As far as I can tell what you're trying to achieve is not data flow (that tracks unchanged data flowing through the program), but rather taint tracking, which tracks so-called "taint" in data, that can get transmitted through data transformation like string concatentation.

You can find more information about this in this section of the docs. In a nutshell, if you replace DataFlow with TaintTracking in your query source you should be able to find the result you're expecting.

@fraudV
Copy link
Author

fraudV commented May 13, 2025

Thank you very much! The previous issue was resolved after changing it to TaintTracking, and here's another related problem.
Taint analysis from String requestData to executorBiz.run(triggerParam); can retrieve results.

Image

But when it comes to "XxlJobExecutor.loadJobThread(triggerParam.getJobId());", no matching result can be found in taint analysis.
I modified it to TaintTracking.
Image

Image

Sink can query the corresponding results.

Image
I checked the Sources of all Expr and Parameter and found paths in other places, but didn't find what I needed.
Image

Image
I walked through it dynamically, and it should be possible that String requestData -> executorBiz.run(triggerParam); -> XxlJobExecutor.loadJobThread(triggerParam.getJobId());
Image

Image

@redsun82
Copy link
Contributor

Hi @fraudV

Am I following correctly that you would like taint to flow through both GsonTool.fromJson (going from requestParam to paramTrigger) and then through the .getJobId() method call of requestParam?

I'm afraid that is not available automatically: gson is not listed as a supported framework in this list. I can raise this to the internal team, to see if built-in support is coming any time soon. In the meantime, you will probably need to model the missing flow yourself implementing predicate isAdditionalFlowStep(Node node1, Node node2) in your DataFlow::ConfigSig implementation to add any flows you're missing.

@fraudV
Copy link
Author

fraudV commented May 14, 2025

Hi @fraudV

Am I following correctly that you would like taint to flow through both GsonTool.fromJson (going from requestParam to paramTrigger) and then through the .getJobId() method call of requestParam?

I'm afraid that is not available automatically: gson is not listed as a supported framework in this list. I can raise this to the internal team, to see if built-in support is coming any time soon. In the meantime, you will probably need to model the missing flow yourself implementing predicate isAdditionalFlowStep(Node node1, Node node2) in your DataFlow::ConfigSig implementation to add any flows you're missing.

Okay, I see. Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants