The os standard library module. os.system() and os.popen() always invoke a shell and are injection sinks. os.exec* variants avoid the shell but are still sinks for the program path. Environment accessors (os.environ, os.getenv) are sources.
.getenv().environ().system().popen().execv().execvp().spawnv().system()Sinkos.system(command: str) -> int
Executes command via the shell. Command-injection sink.
0.popen()Sinkos.popen(command: str, mode: str = 'r') -> IO
Opens a pipe to a shell command. Injection sink.
0.execv()Sinkos.execv(path: str, args: list) -> None
Replaces the current process. Sink for user-controlled program path.
0, 1.execvp()Sinkos.execvp(file: str, args: list) -> None
Like execv but searches PATH. Same injection risk.
0, 1.spawnv()Sinkos.spawnv(mode: int, path: str, args: list) -> int
Spawns a new process. Sink for user-controlled program path.
1, 2| FQN | Field | |
|---|---|---|
| os | fqns[0] |
Wrong FQN → 0 findings. Verify with: change fqns to garbage → must produce 0 results.
from codepathfinder.go_rule import PyOS