Skip to content

Add security-command-injection rule for PHP/WHMCS modules#1

Merged
Stdubic merged 1 commit into
mainfrom
feat/security-command-injection-rule
Mar 23, 2026
Merged

Add security-command-injection rule for PHP/WHMCS modules#1
Stdubic merged 1 commit into
mainfrom
feat/security-command-injection-rule

Conversation

@mladenovic-13

Copy link
Copy Markdown
Collaborator

Detect user input in OS command functions (exec, shell_exec, system, passthru, proc_open, popen) and backtick operators. Covers $_GET, $_POST, $_REQUEST, $_COOKIE, and $params input sources. Skips lines with escapeshellarg/escapeshellcmd sanitization.

Summary

  • Add security-command-injection rule detecting CWE-78 vulnerabilities in PHP/WHMCS
    modules
  • 12 new tests (9 positive + 3 negative)
  • Vulnerable example module (command_injection.php) for CLI demo
  • Updated RULES.md (31 → 32 rules) and vulnerable examples README

Type of Change

  • Bug fix
  • New rule
  • New feature
  • Documentation update
  • Refactoring
  • Other: ___

Checklist

  • npm run validate passes (lint + typecheck + tests + build)
  • New rules have positive and negative test cases
  • Documentation updated if needed
  • No any types introduced

  Detect user input in OS command functions (exec, shell_exec, system,
  passthru, proc_open, popen) and backtick operators. Covers ,
  , , , and  input sources. Skips lines
  with escapeshellarg/escapeshellcmd sanitization.
@Stdubic
Stdubic merged commit cf0d1fc into main Mar 23, 2026
10 of 12 checks passed
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