SOC status:Duty analyst on shift

UK Cyber Defence
VulnerabilityModified

CVE-2009-4142

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…

EXPLOIT ×2 ✓MEDIUM 4.3EPSS 6.50%

Does this matter?

2 public exploits are published in Exploit-DB (verified), so the technical barrier is gone even though the severity is medium and EPSS is 6.5%. Treat it as high on anything reachable from the internet.

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.

CVSS 2.0
4.3 MEDIUMAV:N/AC:M/Au:N/C:N/I:P/A:N
EPSS
6.50% probability · 94th percentile
Public exploits
2 in Exploit-DB · verified · first 17 December 2009
CISA KEV
Not listed
Weakness
CWE-79
Affected
php/php
Source
secalert@redhat.com
EPSS trend
0%5%10%26 October 2026: 6.50%26 October 202626 October 2026

EPSS 6.5% since 26 October 2026; no change recorded yet. The dashed line is the ten per cent mark our analysts treat as “patch before the next change window”. Points are recorded when the score first appears and whenever it moves by a percentage point or more.

Public exploits (2)

Entries in Exploit-DB that cite this CVE. Links go to the Exploit-DB page and to the file in the public repository; nothing is hosted here. A verified tick means the Exploit-DB team confirmed the exploit works against the stated version.

EDB-IDTitleTypePublishedVerified
EDB-33415source ↗PHP 5.2.11 - 'htmlspecialCharacters()' Malformed Multibyte Character Cross-Site Scripting (2)php · hello@iwamot.comremote17 December 2009yes
EDB-33414source ↗PHP 5.2.11 - 'htmlspecialCharacters()' Malformed Multibyte Character Cross-Site Scripting (1)php · hello@iwamot.comremote17 December 2009yes

References

Source: NVD record, EPSS from FIRST.org, KEV from CISA, exploits from Exploit-DB. Refreshed daily. Download this record as JSON.