|
Hi, I would like to identify a source that points to an archive. filename1 = "/home/user/archive.zip"
from pathlib import Path
filename2 = Path("/home/user/archive.zip")I have tried this query as a starting point: import semmle.python.Concepts
from DataFlow::Node source
where source = any(FileSystemAccess fa).getAPathArgument()
select sourceBut it seems the query would identify "data-flow nodes that perform a file system access" and not something "fixed". Please any indication or help is a welcome to locate |
Answered by
alexet
Nov 28, 2022
Replies: 2 comments 2 replies
|
I went with the Thank you |
1 reply
|
If you want to find all string literals ending in ".zip" the following would work. Then if you used taint-flow you would see |
1 reply
Answer selected by
Sim4n6
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you want to find all string literals ending in ".zip" the following would work.
Then if you used taint-flow you would see
filename2was also tainted and therefore get similar results to if filename2 was the source.