Sec Bug->Bug #67356 [Opn]: php loophole GBK

From: Date: Thu, 29 May 2014 04:51:53 +0000
Subject: Sec Bug->Bug #67356 [Opn]: php loophole GBK
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185960@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67356&edit=1 ID: 67356 Updated by: stas@php.net Reported by: xiaobianmail at 126 dot com Summary: php loophole GBK Status: Open -Type: Security +Type: Bug Package: *General Issues Operating System: linux PHP Version: 5.5.12 Block user comment: N Private report: Y Previous Comments: ------------------------------------------------------------------------ [2014-05-29 03:38:43] xiaobianmail at 126 dot com php 5.3 5.4 5.5 ....ALL Version linux windows ------------------------------------------------------------------------ [2014-05-29 03:33:33] xiaobianmail at 126 dot com Description: ------------ When the page encoding is gbk, this code will be fatal error. >php -r 'var_dump("運");' Parse error: syntax error, unexpected end of file, expecting variable (T_VARIABLE) or ${ (T_DOLLAR_OPEN_CURLY_BRACES) or {$ (T_CURLY_OPEN) in Command line code on line 1 Test script: --------------- >php -r 'var_dump("運");' Parse error: syntax error, unexpected end of file, expecting variable (T_VARIABLE) or ${ (T_DOLLAR_OPEN_CURLY_BRACES) or {$ (T_CURLY_OPEN) in Command line code on line 1 <?php //126 GBK error $count = $count2 = 0; for($h = hexdec("8100"); $h <= hexdec("fe00"); $h = $h + 256){ $i=0; for($l=hexdec("0040");$l<=hexdec("00fe");$l++){ $char16 = dechex($h+$l); if(substr($char16,2,2) == '5c'){ echo pack("n*",$h+$l)."<br />"; $count2++; } $i++; $count++; } } echo $count; echo"<br />"; echo $count2; ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67356&edit=1

« previous php.bugs (#185960) next »