php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39846 Invalid IPv4 treated as valid
Submitted: 2006-12-15 19:39 UTC Modified: 2006-12-16 21:48 UTC
From: webvelosix at yahoo dot com Assigned: iliaa (profile)
Status: Closed Package: Filter related
PHP Version: 5.2.0 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: webvelosix at yahoo dot com
New email:
PHP Version: OS:

 

 [2006-12-15 19:39 UTC] webvelosix at yahoo dot com
Description:
------------
Certain invalid IPV4 addresses passed in via _GET are treated as valid.

Reproduce code:
---------------
$input = filter_input(INPUT_GET, "ip", FILTER_VALIDATE_IP, array("flags" => FILTER_FLAG_IPV4));
print(($input === false) ? "Invalid!" : "Valid: ".$input);


Expected result:
----------------
/test.php?ip=192.168.1.100
Valid: 192.168.1.100

/test.php?ip=192.168.1.100random-text-here
Invalid!

Actual result:
--------------
/test.php?ip=192.168.1.100
Valid: 192.168.1.100

/test.php?ip=192.168.1.100random-text-here
Valid: 192.168.1.100random-text-here

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-16 21:48 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 14:01:29 2024 UTC