Skip to content
OpenAdvisories
Unscored Public exploit CVE-2009-4142 EUVD-2009-4112GHSA-q555-wmm9-43g3

The htmlspecialchars function in PHP before 5.2.12 does not properly handle (1) overlong UTF-8 sequences, (2) invalid Shift_JIS sequences, …

Published Dec 21, 2009 · Updated Aug 7, 2024 · Assigned by redhat

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.

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 5.0 php5 5.2.6.dfsg.1-1+lenny6 DSA-2001-1
ReleasePackageFixed inAdvisory
RHEL 5 php +18 5.1.6-24.el5_4.5 RHSA-2010:0040
RHEL 4 php +13 4.3.9-3.29 RHSA-2010:0040
RHEL 3 php +6 4.3.2-54.ent RHSA-2010:0040

Public exploits

Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Advisories 2

References