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…
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 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-ID | Title | Type | Published | Verified |
|---|---|---|---|---|
| EDB-33415source ↗ | PHP 5.2.11 - 'htmlspecialCharacters()' Malformed Multibyte Character Cross-Site Scripting (2)php · hello@iwamot.com | remote | 17 December 2009 | yes |
| EDB-33414source ↗ | PHP 5.2.11 - 'htmlspecialCharacters()' Malformed Multibyte Character Cross-Site Scripting (1)php · hello@iwamot.com | remote | 17 December 2009 | yes |
References
- http://bugs.php.net/bug.php?id=49785
- http://lists.apple.com/archives/security-announce/2010//Mar/msg00001.html
- http://marc.info/?l=bugtraq&m=127680701405735&w=2
- http://secunia.com/advisories/37821Vendor Advisory
- http://secunia.com/advisories/38648
- http://secunia.com/advisories/40262
- http://securitytracker.com/id?1023372Exploit
- http://support.apple.com/kb/HT4077
- http://www.debian.org/security/2010/dsa-2001
- http://www.php.net/ChangeLog-5.phpPatch
- http://www.php.net/releases/5_2_12.php
- http://www.securityfocus.com/bid/37389Exploit
- http://www.vupen.com/english/advisories/2009/3593Vendor Advisory
- https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A10005
- https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A7085
- http://bugs.php.net/bug.php?id=49785
- http://lists.apple.com/archives/security-announce/2010//Mar/msg00001.html
- http://marc.info/?l=bugtraq&m=127680701405735&w=2
- http://secunia.com/advisories/37821Vendor Advisory
- http://secunia.com/advisories/38648
- http://secunia.com/advisories/40262
- http://securitytracker.com/id?1023372Exploit
- http://support.apple.com/kb/HT4077
- http://www.debian.org/security/2010/dsa-2001
- http://www.php.net/ChangeLog-5.phpPatch
- http://www.php.net/releases/5_2_12.php
- http://www.securityfocus.com/bid/37389Exploit
- http://www.vupen.com/english/advisories/2009/3593Vendor Advisory
- https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A10005
- https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A7085
Source: NVD record, EPSS from FIRST.org, KEV from CISA, exploits from Exploit-DB. Refreshed daily. Download this record as JSON.