Unable to get TaintTracking to work in Golang #434
-
Sorry to ask a beginner level question, but I was researching on a file upload vuln based on an unsanitised multipart form into fileURI in a codebase. I have defined my Config to be:
But even though individually the source and sink I have had success finding the vulnerable code from the user input to the execution, when I try to run the TaintTracking I get no results back. Have attempted to check for source.getASuccessor() to look at what Nodes follow from the source of a "call to MultipartForm" but no results came back as well. Unsure of how to proceed. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
You're lucky, there is a brand-new article about debugging data-flow problems! I hope this guide helps: |
Beta Was this translation helpful? Give feedback.
-
You're using a data-flow configuration here when I think you want a taint configuration. The reason you have no flow is because the result of the call is a tuple, and tuple values don't flow anywhere in Go. |
Beta Was this translation helpful? Give feedback.
You're lucky, there is a brand-new article about debugging data-flow problems!
In fact, it's so new that it did not yet reach the official docs website :D
I hope this guide helps:
https://github.com/github/codeql/blob/8c37e90a7776b3561c025c482e2527a74dd44af1/docs/codeql/writing-codeql-queries/debugging-data-flow-queries-using-partial-flow.rst
(if not it would be helpful if you could provide a sample source file that shows which flow you want to find)