Skip to content
Fencer Vulns
medium 4.3

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

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 more
    +4 more products
    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
    fixed: vendor fix RHSA-2010:0040

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

  1. First public exploit (EDB-33415)
  2. 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

Sources

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.