CVE-2008-5940: SQL Injection
SQL injection vulnerability in index.php in MODx 0.9.6.2 and earlier, when magicquotesgpc is disabled, allows remote attackers to execute arbitrary SQL commands via the searchid parameter. NOTE: some of these details are obtained from third party information.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Enable magic_quotes_gpc by setting magic_quotes_gpc = On in your php.ini to ensure incoming GET/POST/COOKIE data is escaped; this mitigates the SQL injection in MODx index.php that occurs when magic_quotes_gpc is disabled.
PHP (php.ini) magic_quotes_gpc = On - Configuration
Modify index.php to validate and sanitize the 'searchid' parameter before using it in SQL (for example, cast/force it to an integer or apply strict validation and use parameterized queries) to prevent SQL injection via the searchid parameter.
MODx (index.php) searchid input handling = validate as integer / sanitize - Compensating control
Configure a web application firewall or request filtering to block or normalize requests containing malicious input in the 'searchid' parameter (for example, enforce numeric-only values for 'searchid' or block SQL metacharacters) to mitigate exploitation of the SQL injection vulnerability in MODx index.php.
Event History
Frequently Asked Questions
What is the severity of CVE-2008-5940?
CVE-2008-5940 is considered a high severity SQL injection vulnerability that can lead to arbitrary SQL command execution.
How do I fix CVE-2008-5940?
To fix CVE-2008-5940, update to MODx version 0.9.6.3 or later.
What versions of MODx are affected by CVE-2008-5940?
CVE-2008-5940 affects MODx versions 0.9.6.2 and earlier.
Can CVE-2008-5940 be exploited remotely?
Yes, CVE-2008-5940 can be exploited remotely by attackers via the searchid parameter.
Is magic_quotes_gpc related to CVE-2008-5940?
Yes, CVE-2008-5940 can be exploited when the magic_quotes_gpc feature is disabled.