php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48310 filter accepts invalid IPv6 address
Submitted: 2009-05-17 16:49 UTC Modified: 2009-07-16 23:33 UTC
Votes:4
Avg. Score:4.5 ± 0.9
Reproduced:4 of 4 (100.0%)
Same Version:3 (75.0%)
Same OS:0 (0.0%)
From: geoffers+phpbugs at gmail dot com Assigned: felipe (profile)
Status: Closed Package: Filter related
PHP Version: 5.*, 6CVS (2009-05-16) OS: Mac OS 10.5.6
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: geoffers+phpbugs at gmail dot com
New email:
PHP Version: OS:

 

 [2009-05-17 16:49 UTC] geoffers+phpbugs at gmail dot com
Description:
------------
The string '0:0:0:255.255.255.255' is not a valid IPv6 address. The 
filter extension allows it.

Reproduce code:
---------------
var_dump(filter_var('0:0:0:255.255.255.255', FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));

Expected result:
----------------
bool(false)

Actual result:
--------------
string(21) "0:0:0:255.255.255.255"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-17 17:18 UTC] geoffers+phpbugs at gmail dot com
Both 5.2 and 5.3 CVS give the same output as 5.2.9
 [2009-06-07 17:00 UTC] birki456 at hotmail dot com
also look at http://bugs.php.net/bug.php?id=46973
this bug is _bogus_ because 1fff::a88:85a3::172.31.128.1 is not a valid ipv6 address (TWO :: in it, that is NOT ALLOWED, see RFC4291)
please fix this.. ipv6 is coming fast
 [2009-07-10 18:38 UTC] jani@php.net
Felipe, since you fixed (?) that other (bogus?) report, please check 
this out too.. :)
 [2009-07-16 23:33 UTC] felipe@php.net
Fixed with #48762. Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 20:01:29 2024 UTC