Bug #76671 [NEW]: bypass strpos verification

From: Date: Fri, 27 Jul 2018 01:33:40 +0000
Subject: Bug #76671 [NEW]: bypass strpos verification
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-216483@lists.php.net to get a copy of this message
From: guilhermeassmannn at gmail dot com Operating system: MacOS High Sierra & Ubuntu 16.04 PHP version: Irrelevant Package: Strings related Bug Type: Bug Bug description:bypass strpos verification Description: ------------ The bug is more related to when we send a string with encode to the strpos(), when we sent a string with double encode we were able to bypass the verification, using %2570hp if the case is like strpos($string, "php"). Test script: --------------- $x = $_GET['x']; //?x=file:///var/www/html/readme.%2570hp $pos = strpos($x,"php"); if($pos){ exit("denied"); } $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,"$x"); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); $result = curl_exec($ch); echo $result; Expected result: ---------------- denied Actual result: -------------- <?php //readme ?> -- Edit bug report at https://bugs.php.net/bug.php?id=76671&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76671&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76671&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76671&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=76671&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=76671&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=76671&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=76671&r=needscript Try newer version: https://bugs.php.net/fix.php?id=76671&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=76671&r=support Expected behavior: https://bugs.php.net/fix.php?id=76671&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=76671&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=76671&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=76671&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76671&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=76671&r=dst IIS Stability: https://bugs.php.net/fix.php?id=76671&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=76671&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=76671&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=76671&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=76671&r=mysqlcfg

« previous php.bugs (#216483) next »