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

Module PathInjection

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

Since the path-injection configuration setup is rather complicated, we do not expose a Sanitizer class, and instead you should extend Path::PathNormalization::Range and Path::SafeAccessCheck::Range from semmle.python.Concepts instead.

Import path

import semmle.python.security.dataflow.PathInjectionCustomizations

Classes

FileSystemAccessAsSink

A file system access, considered as a flow sink.

RemoteFlowSourceAsSource

A source of remote user input, considered as a flow source.

Sanitizer

A sanitizer for “path injection” vulnerabilities.

SanitizerGuard

DEPRECATED: Use Sanitizer instead.

Sink

A data flow sink for “path injection” vulnerabilities. Such as a file system access.

Source

A data flow source for “path injection” vulnerabilities.

StringConstCompareAsSanitizerGuard

A comparison with a constant string, considered as a sanitizer-guard.