sdk/python/File System

File System

os.path, tempfile, pathlib — path traversal and temp file handling

All 14Source: 2Sink: 7Sanitizer: 3
PyAiofiles
aiofiles

aiofiles provides async file I/O. aiofiles.open() is a path-traversal sink when the path is user-controlled (same as built-in open).

1 sink1 methods
PyConfigparser
configparser

The configparser module reads INI-style config files. Values read via get() are sources when the config file is user-supplied. The module itself has no injection sinks of its own.

1 source3 methods
PyDockerfileParse
dockerfile_parse

dockerfile_parse parses Dockerfiles. Returned structures reflect user-controlled file content. Usually a source for linting rules, not a sink.

1 source1 methods
PyFileinput
fileinput

Python stdlib module — fileinput. Auto-indexed from CDN. Method-level security roles have not been annotated; rule writers should inspect the source before use.

10 methods
PyFnmatch
fnmatch

Python stdlib module — fnmatch. Auto-indexed from CDN. Method-level security roles have not been annotated; rule writers should inspect the source before use.

4 methods
PyGlob
glob

The glob module. glob.glob() resolves shell-style patterns against the filesystem — finding when the pattern is user-controlled (can enumerate directories outside intended scope).

2 sinks2 methods
PyLogging
logging

The logging module. Most uses are neutral. Log-injection findings arise when user-controlled data is logged without sanitization — attackers can break log line boundaries with \n or forge subsequent log entries.

4 sinks4 methods
PyMimetypes
mimetypes

Python stdlib module — mimetypes. Auto-indexed from CDN. Method-level security roles have not been annotated; rule writers should inspect the source before use.

7 methods
PyOSPath
os.path

The os.path module for path manipulation. join() concatenates path components but does not resolve traversal sequences — path-traversal bug when joining a trusted base with a user-controlled path. Use os.path.commonpath + realpath containment checks to sanitize.

2 sanitizers4 methods
PyPathlib
pathlib

The pathlib module is the modern OO path API. Path.resolve() expands symlinks (sanitizer when combined with containment check). Path.open / read_text / write_text are file I/O sinks when the path is user-controlled.

3 sinks1 sanitizer5 methods
PyRe
re

The re module. Catastrophic backtracking in regex patterns (ReDoS) — finding when a user-controlled pattern flows into re.compile / re.search / re.match. Also, re.findall on untrusted HTML is a common anti-pattern that misses cases.

4 sinks4 methods
PyRegex
regex

Third-party Python package module — regex. Auto-indexed from CDN. Method-level security roles have not been annotated; rule writers should inspect the source before use.

0 methods
PyShutil
shutil

The shutil module for high-level file operations. unpack_archive automatically extracts tar / zip / gztar / bztar / xztar archives — same zip-slip risks as tarfile.extractall. copytree can also be used for path-traversal.

4 sinks5 methods
PyTempfile
tempfile

The tempfile module. mktemp() is deprecated and insecure (race condition between filename generation and open). Use NamedTemporaryFile, mkstemp, or TemporaryDirectory which atomically create the file.

1 sink2 sanitizers3 methods