Skip to content

Conversation

@niceysam
Copy link

@niceysam niceysam commented Feb 13, 2026

Adds four Python security patterns to the security-guidance plugin hook that were missing from the existing set:

  • subprocess_shell_injection — catches shell=True in subprocess calls (command injection risk)
  • yaml_unsafe_load — catches yaml.load() without SafeLoader (arbitrary code execution)
  • tls_verification_disabled — catches verify=False in HTTP requests (MITM attacks)
  • tempfile_insecure — catches tempfile.mktemp() (race condition / symlink attacks)

The existing patterns cover eval/exec/os.system/pickle but miss these four, which OWASP and Python security guides consistently flag. Each pattern includes a warning message explaining what is unsafe and what to use instead.

Tested all patterns match correctly without affecting existing ones.

… yaml, TLS, and tempfile

Add four new security patterns to the security-guidance plugin hook:

- subprocess_shell_injection: Warns when shell=True is used with
  subprocess, which can lead to command injection
- yaml_unsafe_load: Warns when yaml.load() is used without SafeLoader,
  which can execute arbitrary code
- tls_verification_disabled: Warns when verify=False disables TLS
  certificate verification
- tempfile_insecure: Warns when tempfile.mktemp() is used, which is
  vulnerable to race condition attacks

These are well-known Python security pitfalls that the existing patterns
did not cover.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants