File System

PyGlob

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 sinks
Taint flow0 sources 2 sinks
Sinks — dangerous call
.glob()
.iglob()

Sinks

.glob()Sink
#
Signature
glob.glob(pathname, *, root_dir=None, dir_fd=None, recursive=False, ...) -> list[str]

Returns matching paths. Finding when pathname is user-controlled.

tracks:0
.iglob()Sink
#
Signature
glob.iglob(pathname, *, root_dir=None, ...) -> Iterator[str]

Like glob() but returns an iterator. Same risk.

tracks:0

Fully-Qualified Names

FQNField
globfqns[0]

Wrong FQN → 0 findings. Verify with: change fqns to garbage → must produce 0 results.

Import

rule.py
from codepathfinder.go_rule import PyGlob