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
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: 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

Add a Patch

Pull Requests

Add a Pull Request

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: Sat Apr 20 00:01:27 2024 UTC