Why it matters
The caller can overwrite any variable in scope, such as $isAdmin or $userId.
How to fix it
Read the fields you need explicitly, and always pass parse_str a second argument that receives the result.
Example
The rule's own test fixtures, verbatim: the test suite requires the rule to report the first and not the second.
<?php
$isAdmin = false;
extract($_POST);<?php
$isAdmin = false;
parse_str($_SERVER['QUERY_STRING'] ?? '', $query);
$name = $query['name'] ?? '';What TrustIvan reads
Runs on repository scans of PHP source once static analysis is turned on (SAST_RULES and the separately built analyzer image); it is off by default.
Weakness classes and references
Related checks
- XXE libxml NOENT (PHP)
PHPSeverity: High
trustivan-php-xxe-libxml-noent - Hardcoded password database connection (PHP)
PHPSeverity: High
trustivan-php-hardcoded-password-database-connection - Unserialize without allowed classes (PHP)
PHPSeverity: Medium
trustivan-php-unserialize-without-allowed-classes - JWT hardcoded secret (PHP)
PHPSeverity: High
trustivan-php-jwt-hardcoded-secret - TLS verification disabled (PHP)
PHPSeverity: High
trustivan-php-tls-verification-disabled - Laravel CSRF except all (PHP)
PHPSeverity: Medium
trustivan-php-laravel-csrf-except-all
Terms: SAST (static application security testing), Taint analysis, CWE (Common Weakness Enumeration), OWASP Top 10
All static analysis (SAST) checks · The whole catalogue · How this works in TrustIvan · Documentation