Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 filesystemaccess
*/
import python
import semmle.python.dataflow.new.DataFlow
import semmle.python.dataflow.new.TaintTracking
Expand All @@ -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
Copy link
Contributor

@owen-mc owen-mc Oct 10, 2025

Choose a reason for hiding this comment

The 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
import RemoteToFileFlow::PathGraph
module RemoteToFileFlow = TaintTracking::Global<RemoteToFileConfiguration>;
module RemoteToFileFlow = TaintTracking::Global<RemoteToFileConfiguration>;
import RemoteToFileFlow::PathGraph

Copy link
Contributor

Choose a reason for hiding this comment

The 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:
Expand Down