Bug #67375 [NEW]: JIT enabled sometimes breaks filters
| From: | garyamort at gmail dot com | Date: | Tue, 03 Jun 2014 17:21:38 +0000 |
| Subject: | Bug #67375 [NEW]: JIT enabled sometimes breaks filters | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-186035@lists.php.net to get a copy of this message | ||
From: garyamort at gmail dot com
Operating system: Arch Linux 64bit
PHP version: 5.5.13
Package: Filter related
Bug Type: Bug
Bug description:JIT enabled sometimes breaks filters
Description:
------------
In some situations, if you have auto_globals_jit enables then not only
are super global variables not initialized unless they are called, the
underlying data storage for the original data[used by filter_input] will
not be populated.
As I read filter.c, there seems to be a weird schism on how it deals
with this.
https://github.com/php/php-src/blob/master/ext/filter/filter.c#L526
For INPUT_SERVER and INPUT_ENV it seems as if filter will make sure to
initialize the data, example:
if (PG(auto_globals_jit)) {
zend_is_auto_global("_SERVER",
sizeof("_SERVER")-1 TSRMLS_CC);
}
For INPUT_POST, INPUT_GET, and INPUT_COOKIE however there is no safety
net.
Test script:
---------------
<?php
// execute from web browser as http://domain/filename.php?test=123
$before = filter_input(INPUT_GET, 'test'); // $before = null
$var = $_GET('test'); // $var = 'test'
$after = filter_input(INPUT_GET, 'test'); // $after = 'test'
if ($before !== $after)
{
echo 'Raw input failed to load';
}
--
Edit bug report at https://bugs.php.net/bug.php?id=67375&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67375&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67375&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67375&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=67375&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=67375&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=67375&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=67375&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=67375&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=67375&r=support
Expected behavior: https://bugs.php.net/fix.php?id=67375&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=67375&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=67375&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=67375&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67375&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=67375&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=67375&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=67375&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=67375&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=67375&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=67375&r=mysqlcfg