CodeQL library for Python
codeql/python-all 2.2.0 (changelog, source)
Search

Module PathInjectionQuery

Provides taint-tracking configurations for detecting “path injection” vulnerabilities.

Note, for performance reasons: only import this file if PathInjection::Configuration is needed, otherwise PathInjectionCustomizations should be imported instead.

Import path

import semmle.python.security.dataflow.PathInjectionQuery

Imports

DataFlow

Provides a library for local (intra-procedural) and global (inter-procedural) data flow analysis: deciding whether data can flow from a source to a sink.

PathInjection

Provides default sources, and sinks for detecting “path injection” vulnerabilities, as well as extension points for adding your own.

TaintTracking

Provides classes for performing local (intra-procedural) and global (inter-procedural) taint-tracking analyses.

Classes

Configuration

DEPRECATED: Use PathInjectionFlow module instead.

FlowState
NormalizedUnchecked

A state signifying that the file path has been normalized, but not checked.

NotNormalized

A state signifying that the file path has not been normalized.

Modules

PathInjectionConfig

This configuration uses two flow states, NotNormalized and NormalizedUnchecked, to track the requirement that a file path must be first normalized and then checked before it is safe to use.

Aliases

PathInjectionFlow

Global taint-tracking for detecting “path injection” vulnerabilities.