I'm having trouble tracking variable propagation #892
Unanswered
Light1Smile
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hi I know that for other languages, when the taint source happens inside a constructor or a field initializer, like in your example above, and there is not explicit call to the constructor follow by a call to the method containing the sink, then we will not flag it. I suspect the same happens for Python. It is on our radar to fix. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm having trouble tracking variable propagation.
I'm writing a CodeQL query to help me trace how a model flows through a program. However, I found that using data flow analysis or taint tracking doesn't work very well in this case.
Here's my query:
For the following code, it fails to properly track the flow of "ssube/stable-diffusion-x4-upscaler-onnx". This string is first passed to hub_checkpoint, and then by default, if test_pipeline_default_ddpm is used, it gets passed to self.hub_checkpoint. However, when I try to perform a data flow or taint analysis with "ssube/stable-diffusion-x4-upscaler-onnx" as the source and self.hub_checkpoint (the first argument to OnnxStableDiffusionUpscalePipeline.from_pretrained) as the sink, CodeQL fails to connect them effectively.
I understand that this might require taint tracking and defining isAdditionalFlowStep, but I haven't found any detailed tutorials related to this, so I'm not sure how to improve the query. Could anyone offer some suggestions?
Secondly, when a string is treated as tainted and then processed by some method, it is not propagated by default. For example, in the code below, if I want to make the taint propagation more permissive—so that passing through method parameters or method calls still allows propagation—how can I do that?—because in some cases I only want to analyze the propagation rather than treating it as actual taint, what should I do?
I would be most grateful if someone could offer help:)
Beta Was this translation helpful? Give feedback.
All reactions