CVE-2012-0831 SQL injection in n/a

Medium 6.8 Published Updated

Remote attackers can exploit improper handling of magic_quotes_gpc during environment variable import to conduct SQL injection attacks against PHP applications.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2012-0831?

CVE-2012-0831 is a medium-severity SQL injection vulnerability in Php Php, published on 10 Feb 2012. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

PHP before 5.3.10 does not properly perform a temporary change to the magic_quotes_gpc directive during the importing of environment variables, which makes it easier for remote attackers to conduct SQL injection attacks via a crafted request, related to main/php_variables.c, sapi/cgi/cgi_main.c, and sapi/fpm/fpm/fpm_main.c.

Weakness: CWE-20

Which versions are affected by CVE-2012-0831?

It affects 1 product.

Products include Php Php.

How do I fix CVE-2012-0831?

Upgrade to a fixed version.

Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.

Is CVE-2012-0831 being exploited?

There is no known exploitation of CVE-2012-0831 in the wild and no public exploit code.

All Php Php vulnerabilities

Sources

Also known as GHSA-p39c-84x2-h365.

Is CVE-2012-0831 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free