#45606 [NEW]: FILTER_SANITIZE_NUMBER_INT filters returns "----" as an int

From: Date: Wed, 23 Jul 2008 16:47:52 +0000
Subject: #45606 [NEW]: FILTER_SANITIZE_NUMBER_INT filters returns "----" as an int
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-127204@lists.php.net to get a copy of this message
From:             php at displague dot com
Operating system: ubuntu intrepid
PHP version:      5.2.6
PHP Bug Type:     Filter related
Bug description:  FILTER_SANITIZE_NUMBER_INT filters returns  "----" as an int

Description:
------------
In code where I use

filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT,
array('options'=>array('min_range'=>1)));

a vulnerability scanner tried to supply a value of <!-- test --> to the id
parameter of the page.

This filter statement caused $id=='----'.

Reproduce code:
---------------
$t="<!-- test -->";
$v=filter_var($t, FILTER_SANITIZE_NUMBER_INT,
array('options'=>array('min_range'=>1)));

Expected result:
----------------
$v==false

Actual result:
--------------
$v=='----'

-- 
Edit bug report at http://bugs.php.net/?id=45606&edit=1
-- 
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45606&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45606&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45606&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45606&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=45606&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45606&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45606&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45606&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45606&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45606&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=45606&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=45606&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45606&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45606&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45606&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45606&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45606&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45606&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45606&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45606&r=mysqlcfg



Thread (6 messages)

« previous php.bugs (#127204) next »