Rules/issue 63 to Development #81
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
eval()with any variable (PHP)Why always critical: Legitimate
eval()in WordPress is extremely rare. Dynamic code execution is the hallmark of malware and backdoors.False positive rate: Very low (<5%)
Current coverage:
njs-001-eval-injection(pattern JSON + direct pattern runner)php-eval-injection(new Tier 1 rule, implemented incheck-performance.shv1.3.7)Status: Implemented in scanner (Node.js + PHP) as of v1.3.7.
include/requirewith variablesWhy always critical: File inclusion with user input leads directly to remote code execution. Even with sanitization, this pattern is dangerous.
False positive rate: Low (~10%). Some template loaders do this safely, but they should use whitelists.
Current coverage:
php-dynamic-include(new Tier 1 rule, implemented incheck-performance.shv1.3.7)Status: Implemented in scanner (PHP) as of v1.3.7.
shell_exec/exec/system/passthru(any usage)Why always critical: Command execution in a web context is high-risk. Even "safe" uses (image processing, etc.) should be reviewed for injection vectors.
False positive rate: Medium (~20%). Legitimate uses exist but are rare in WordPress themes/plugins.
Current coverage:
njs-002-command-injection(server-side command injection checks)php-shell-exec-functions(new Tier 1 rule, implemented incheck-performance.shv1.3.8)Status: Implemented in scanner (PHP + Node.js coverage) as of v1.3.8.
Why always critical: Arbitrary file write allows attackers to create PHP backdoors anywhere in the filesystem.
False positive rate: Low (~10%). The pattern of user input → file path is specific.
Current coverage:
php-user-controlled-file-write(Tier 1 rule, implemented incheck-performance.shv1.3.9; detection hardened in v1.3.10)Status: Implemented in scanner (PHP) as of v1.3.9; detection bug fixed in v1.3.10.
Why always critical: Credentials in code get committed to repos, leaked in error messages, and exposed in backups.
False positive rate: Medium (~25%). Example code and tests may trigger this, but the risk of missing a real exposure is too high.
Current coverage:
headless-api-key-exposure(existing rule for browser bundles)php-hardcoded-credentials(new Tier 1 rule, implemented incheck-performance.shv1.3.9)Status: Implemented in scanner (PHP + client-side JS coverage) as of v1.3.9.