CVE-2009-4142 json
The htmlspecialchars function in PHP before 5.2.12 does not properly handle (1) overlong UTF-8 sequences, (2) invalid Shift_JIS sequences,…
published 2009-12-21 16 y ago modified 2026-06-16 4 mo ago also EUVD-2009-4112
- cvss
- 4.3
- version 2.0, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 6.5%
- EPSS 6.5% chance of exploitation in 30 days, percentile 93%
- public exploits
- 2
- Exploit-DB
Summary
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.
Patch / fix
- php RHEL 3 4.3.2-54.ent
- php RHEL 4 4.3.9-3.29
- php RHEL 5 5.1.6-24.el5_4.5
- php-gd RHEL 4 4.3.9-3.29
- php-gd RHEL 5 5.1.6-24.el5_4.5
- php-cli RHEL 5 5.1.6-24.el5_4.5
- php-dba RHEL 5 5.1.6-24.el5_4.5
- php-pdo RHEL 5 5.1.6-24.el5_4.5
red hat advisories RHSA-2010:0040
- php.net/ChangeLog-5.php patch
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2009-4142 updated cvss 4.3
php: htmlspecialchars() insufficient checking of input for multi-byte encodings
-
Red Hat Desktop version 3 php 4.3.2-54.ent, php-imap 4.3.2-54.ent, php-ldap 4.3.2-54.ent, php-odbc 4.3.2-54.ent, php-mysql 4.3.2-54.ent, php-pgsql 4.3.2-54.ent Red Hat Enterprise Linux (v. 5 server) php 5.1.6-24.el5_4.5, php-gd 5.1.6-24.el5_4.5, php-cli 5.1.6-24.el5_4.5, php-dba 5.1.6-24.el5_4.5, php-pdo 5.1.6-24.el5_4.5, php-xml 5.1.6-24.el5_4.5, +12 more Red Hat Enterprise Linux AS version 3 php 4.3.2-54.ent, php-imap 4.3.2-54.ent, php-ldap 4.3.2-54.ent, php-odbc 4.3.2-54.ent, php-mysql 4.3.2-54.ent, php-pgsql 4.3.2-54.ent Red Hat Enterprise Linux AS version 4 php 4.3.9-3.29, php-gd 4.3.9-3.29, php-imap 4.3.9-3.29, php-ldap 4.3.9-3.29, php-odbc 4.3.9-3.29, php-pear 4.3.9-3.29, +7 more Red Hat Enterprise Linux Desktop version 4 php 4.3.9-3.29, php-gd 4.3.9-3.29, php-imap 4.3.9-3.29, php-ldap 4.3.9-3.29, php-odbc 4.3.9-3.29, php-pear 4.3.9-3.29, +7 more Red Hat Enterprise Linux Desktop Workstation (v. 5 client) php 5.1.6-24.el5_4.5, php-gd 5.1.6-24.el5_4.5, php-cli 5.1.6-24.el5_4.5, php-dba 5.1.6-24.el5_4.5, php-pdo 5.1.6-24.el5_4.5, php-xml 5.1.6-24.el5_4.5, +12 morefixed: vendor fix RHSA-2010:0040
+4 more productsfewer
Red Hat Enterprise Linux ES version 3 php 4.3.2-54.ent, php-imap 4.3.2-54.ent, php-ldap 4.3.2-54.ent, php-odbc 4.3.2-54.ent, php-mysql 4.3.2-54.ent, php-pgsql 4.3.2-54.ent Red Hat Enterprise Linux ES version 4 php 4.3.9-3.29, php-gd 4.3.9-3.29, php-imap 4.3.9-3.29, php-ldap 4.3.9-3.29, php-odbc 4.3.9-3.29, php-pear 4.3.9-3.29, +7 more Red Hat Enterprise Linux WS version 3 php 4.3.2-54.ent, php-imap 4.3.2-54.ent, php-ldap 4.3.2-54.ent, php-odbc 4.3.2-54.ent, php-mysql 4.3.2-54.ent, php-pgsql 4.3.2-54.ent Red Hat Enterprise Linux WS version 4 php 4.3.9-3.29, php-gd 4.3.9-3.29, php-imap 4.3.9-3.29, php-ldap 4.3.9-3.29, php-odbc 4.3.9-3.29, php-pear 4.3.9-3.29, +7 more
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Timeline
- First public exploit (EDB-33415)
- Published
Exploit prediction
6.50% chance of exploitation in the next 30 days, higher than 93% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- EDB-33415 PHP 5.2.11 - 'htmlspecialCharacters()' Malformed Multibyte Character Cross-Site Scripting (2) remote, 2009-12-17
- EDB-33414 PHP 5.2.11 - 'htmlspecialCharacters()' Malformed Multibyte Character Cross-Site Scripting (1) remote, 2009-12-17
- securityfocus.com http://www.securityfocus.com/bid/37389 referenced PoC, tagged "exploit" by a source, unverified
- securitytracker.com http://securitytracker.com/id?1023372 referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 2.0 | 4.3 | AV:N/AC:M/Au:N/C:N/I:P/A:N |
Classification
- Weakness
-
- CWE-79 Improper Neutralization of Input During Web Page Generation
- Technology feeds
References
-
php.net
/ChangeLog-5.php
patch
-
securityfocus.com
/bid/37389
vdb-entry, exploit
-
securitytracker.com
/id?1023372
vdb-entry, exploit
-
marc.info
/?l=bugtraq&m=127680701405735&w=2
vendor-advisory
-
lists.apple.com
/archives/security-announce/2010//Mar/msg00001.html
vendor-advisory
-
debian.org
/security/2010/dsa-2001
vendor-advisory
-
secunia.com
/advisories/37821
third-party-advisory, vendor-advisory
-
vupen.com
/english/advisories/2009/3593
vdb-entry, vendor-advisory
- php.net /releases/5_2_12.php
- bugs.php.net /bug.php?id=49785
-
secunia.com
/advisories/40262
third-party-advisory
-
secunia.com
/advisories/38648
third-party-advisory
-
oval.cisecurity.org
/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A7085
vdb-entry, signature
-
oval.cisecurity.org
/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A10005
vdb-entry, signature
- support.apple.com /kb/HT4077
Sources
- CVE List CVE-2009-4142
- NVD CVE-2009-4142
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.