-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Docs: fix taint tracking query #20620
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -303,6 +303,11 @@ This query shows a data flow configuration that uses all network input as data s | |||||||||||||
|
||||||||||||||
.. code-block:: ql | ||||||||||||||
|
||||||||||||||
/** | ||||||||||||||
* @kind path-problem | ||||||||||||||
* @problem.severity warning | ||||||||||||||
* @id filesystemacess | ||||||||||||||
*/ | ||||||||||||||
import python | ||||||||||||||
import semmle.python.dataflow.new.DataFlow | ||||||||||||||
import semmle.python.dataflow.new.TaintTracking | ||||||||||||||
|
@@ -319,11 +324,13 @@ This query shows a data flow configuration that uses all network input as data s | |||||||||||||
} | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
import RemoteToFileFlow::PathGraph | ||||||||||||||
|
||||||||||||||
module RemoteToFileFlow = TaintTracking::Global<RemoteToFileConfiguration>; | ||||||||||||||
Comment on lines
+327
to
329
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I normally put these two lines the other way round, so you define the module above where you import its submodule.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did a quick search for Go and python and the import comes after the module in all the cases I looked at (where they're both in the same file). |
||||||||||||||
|
||||||||||||||
from DataFlow::Node input, DataFlow::Node fileAccess | ||||||||||||||
where RemoteToFileFlow::flow(input, fileAccess) | ||||||||||||||
select fileAccess, "This file access uses data from $@.", | ||||||||||||||
from RemoteToFileFlow::PathNode input, RemoteToFileFlow::PathNode fileAccess | ||||||||||||||
where RemoteToFileFlow::flowPath(input, fileAccess) | ||||||||||||||
select fileAccess.getNode(), input, fileAccess, "This file access uses data from $@.", | ||||||||||||||
input, "user-controllable input." | ||||||||||||||
|
||||||||||||||
This data flow configuration tracks data flow from environment variables to opening files: | ||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.