CVE-2009-4142 Cross-site scripting in n/a

Medium 4.3 Published Updated

Remote attackers can execute cross-site scripting attacks by exploiting improper handling of invalid character sequences in the PHP htmlspecialchars function.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2009-4142?

CVE-2009-4142 is a medium-severity cross-site scripting vulnerability in Php Php, published on 21 Dec 2009. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

The htmlspecialchars function in PHP before 5.2.12 does not properly handle (1) overlong UTF-8 sequences, (2) invalid Shift_JIS sequences, and (3) invalid EUC-JP sequences, which allows remote attackers to conduct cross-site scripting (XSS) attacks by placing a crafted byte sequence before a special character.

Weakness: CWE-79

Which versions are affected by CVE-2009-4142?

It affects 1 product.

Products include Php Php.

How do I fix CVE-2009-4142?

Upgrade to a fixed version.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2009-4142 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2009-4142 exists.

Public exploit code: 2 Exploit-DB entries.

All Php Php vulnerabilities

Sources

Also known as GHSA-q555-wmm9-43g3.

Is CVE-2009-4142 in your software?

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

Check your SBOMs for free