{"id":"CVE-2009-4142","url":"https://www.cyber-defence.io/tools/cve/CVE-2009-4142","generatedAt":"2026-10-27T19:38:39.899Z","title":"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…","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.","published":"2009-12-21T16:30:00.000Z","lastModified":"2026-06-16T23:13:07.000Z","status":"Modified","sourceIdentifier":"secalert@redhat.com","cvss":{"version":"2.0","score":4.3,"severity":"MEDIUM","vector":"AV:N/AC:M/Au:N/C:N/I:P/A:N"},"cwe":["CWE-79"],"affected":["php/php"],"epss":{"score":0.06497,"percentile":0.93717,"date":"2026-10-26","history":[]},"kev":{"listed":false},"exploits":{"count":2,"verified":true,"firstPublished":"2009-12-17","source":"Exploit-DB (https://gitlab.com/exploit-database/exploitdb)","entries":[{"edbId":33415,"kind":"exploit","title":"PHP 5.2.11 - 'htmlspecialCharacters()' Malformed Multibyte Character Cross-Site Scripting (2)","url":"https://www.exploit-db.com/exploits/33415","sourceUrl":"https://gitlab.com/exploit-database/exploitdb/-/blob/main/exploits/php/remote/33415.php","file":"exploits/php/remote/33415.php","published":"2009-12-17","added":"2009-12-17","updated":"2014-05-19","author":"hello@iwamot.com","type":"remote","platform":"php","port":null,"verified":true,"codes":["CVE-2009-4142","OSVDB-61209"],"tags":null,"aliases":null,"applicationUrl":null,"screenshotUrl":null,"referenceUrl":"https://www.securityfocus.com/bid/37389/info"},{"edbId":33414,"kind":"exploit","title":"PHP 5.2.11 - 'htmlspecialCharacters()' Malformed Multibyte Character Cross-Site Scripting (1)","url":"https://www.exploit-db.com/exploits/33414","sourceUrl":"https://gitlab.com/exploit-database/exploitdb/-/blob/main/exploits/php/remote/33414.php","file":"exploits/php/remote/33414.php","published":"2009-12-17","added":"2009-12-17","updated":"2014-05-19","author":"hello@iwamot.com","type":"remote","platform":"php","port":null,"verified":true,"codes":["CVE-2009-4142","OSVDB-61209"],"tags":null,"aliases":null,"applicationUrl":null,"screenshotUrl":null,"referenceUrl":"https://www.securityfocus.com/bid/37389/info"}]},"verdict":{"level":"high","text":"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."},"changes":[],"references":[{"url":"http://bugs.php.net/bug.php?id=49785","source":"secalert@redhat.com"},{"url":"http://lists.apple.com/archives/security-announce/2010//Mar/msg00001.html","source":"secalert@redhat.com"},{"url":"http://marc.info/?l=bugtraq&m=127680701405735&w=2","source":"secalert@redhat.com"},{"url":"http://secunia.com/advisories/37821","tags":["Vendor Advisory"],"source":"secalert@redhat.com"},{"url":"http://secunia.com/advisories/38648","source":"secalert@redhat.com"},{"url":"http://secunia.com/advisories/40262","source":"secalert@redhat.com"},{"url":"http://securitytracker.com/id?1023372","tags":["Exploit"],"source":"secalert@redhat.com"},{"url":"http://support.apple.com/kb/HT4077","source":"secalert@redhat.com"},{"url":"http://www.debian.org/security/2010/dsa-2001","source":"secalert@redhat.com"},{"url":"http://www.php.net/ChangeLog-5.php","tags":["Patch"],"source":"secalert@redhat.com"},{"url":"http://www.php.net/releases/5_2_12.php","source":"secalert@redhat.com"},{"url":"http://www.securityfocus.com/bid/37389","tags":["Exploit"],"source":"secalert@redhat.com"},{"url":"http://www.vupen.com/english/advisories/2009/3593","tags":["Vendor Advisory"],"source":"secalert@redhat.com"},{"url":"https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A10005","source":"secalert@redhat.com"},{"url":"https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A7085","source":"secalert@redhat.com"},{"url":"http://bugs.php.net/bug.php?id=49785","source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://lists.apple.com/archives/security-announce/2010//Mar/msg00001.html","source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://marc.info/?l=bugtraq&m=127680701405735&w=2","source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://secunia.com/advisories/37821","tags":["Vendor Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://secunia.com/advisories/38648","source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://secunia.com/advisories/40262","source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://securitytracker.com/id?1023372","tags":["Exploit"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://support.apple.com/kb/HT4077","source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://www.debian.org/security/2010/dsa-2001","source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://www.php.net/ChangeLog-5.php","tags":["Patch"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://www.php.net/releases/5_2_12.php","source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://www.securityfocus.com/bid/37389","tags":["Exploit"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"http://www.vupen.com/english/advisories/2009/3593","tags":["Vendor Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A10005","source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A7085","source":"af854a3a-2127-422b-91ae-364da2661108"}],"sources":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2009-4142","epss":"https://www.first.org/epss/","kev":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","exploitdb":"https://www.exploit-db.com/"},"licence":"CC BY 4.0 — link back to the CVE Explorer if you publish the results; upstream data remains subject to its own terms."}