Results 1 to 3 of 3

Thread: IPv6 support in Request::GetRemoteAddr()

  1. #1
    Junior Member
    Join Date
    Nov 2011
    Posts
    15

    IPv6 support in Request::GetRemoteAddr()

    Hi there,

    I'm working on z-push 2.6.3-beta1

    I've seen garbled log messages for clients using IPv6, it seems as if a-f and : have been stripped.. leaving just the numbers of the IP address.

    $_SERVER['REMOTE_ADDR'] is being filtered through Request::filterEvilInput with NUMBERSDOT_ONLY

    This function doesn't strictly speaking validate an IPv4 address and due the way is strips a-f and :, it will mangle IPv6 addresses.

    I propose this diff which replaces the call to filterEvilInput with a call to a new function filterIP

    This function uses PHPs inet_ntop and inet_pton which use syscalls to validate IP addresses (both v4 and v6). These calls can be trusted over potentially flawed regex.

    In the case that the input to this function is a bad IP address (or something that is not understood) then it reverts to the previous behaviour of calling filterEvilInput with the extended prefix "badip-" attached to the result.
    Attached Files Attached Files
    Last edited by cpitchord; 17-04-2017 at 08:59 PM. Reason: clarify product being used

  2. #2
    Senior Member
    Join Date
    Sep 2007
    Location
    Aka SebastianBrasil
    Posts
    1,467
    Hey,

    I created a ticket for this:

    Would you be willing to contribute this code directly via git?
    Please see instructions here:

    Cheers,
    Sebastian

  3. #3
    Junior Member
    Join Date
    Nov 2011
    Posts
    15
    Sure thing, that'll be great.

    I get to work this evening

Similar Threads

  1. EWS Support
    By SBOffice in forum Administration and Integration
    Replies: 9
    Last Post: 15-11-2014, 10:47 AM
  2. IMAP and caldav problems after upgrade to 7.1.10 from 7.1.9 on IPv6 multistack
    By baul in forum Installation, Configuration and Maintenance
    Replies: 3
    Last Post: 04-08-2014, 06:43 PM
  3. Where do paid customers request support...
    By mikescholes in forum Administration and Integration
    Replies: 1
    Last Post: 06-03-2014, 12:08 PM
  4. Replies: 9
    Last Post: 19-06-2012, 04:12 PM
  5. zarafa-gateway listen on IPV6 address
    By kawa4dust in forum Installation, Configuration and Maintenance
    Replies: 6
    Last Post: 11-06-2012, 12:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •