RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1484034 - glibc: Stricter IPv6 address parser
Summary: glibc: Stricter IPv6 address parser
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: glibc
Version: 7.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Florian Weimer
QA Contact: Sergey Kolosov
Vladimír Slávik
URL:
Whiteboard:
Depends On:
Blocks: 677316
TreeView+ depends on / blocked
 
Reported: 2017-08-22 13:34 UTC by Florian Weimer
Modified: 2018-05-03 08:57 UTC (History)
7 users (show)

Fixed In Version: glibc-2.17-202.el7
Doc Type: Bug Fix
Doc Text:
Invalid IPv6 scope IDs no longer incorrectly accepted by `getaddrinfo()` Previously, the GNU C Library ( *glibc* ) function `getaddrinfo()` erroneously accepted invalid IPv6 scope IDs. As a consequence, strings such as `::%-1` or `2001:db8::1%037777777777` were incorrectly parsed as valid IPv6 addresses. The `getaddrinfo()` implementation has been changed to reject such invalid IPv6 scope IDs and return a name resolution failure instead. As a result, such invalid IPv6 address strings are no longer accepted by applications using the `getaddrinfo()` function.
Clone Of:
Environment:
Last Closed: 2018-04-10 14:00:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1574405 1 None None None 2023-07-18 14:30:35 UTC
Red Hat Product Errata RHSA-2018:0805 0 None None None 2018-04-10 14:01:54 UTC
Sourceware 16637 0 P2 RESOLVED inet_pton function is accepting IPv6 with bad format 2020-09-11 00:21:47 UTC
Sourceware 20611 0 P2 RESOLVED getaddrinfo accepts invalid numeric scope IDs 2020-09-11 00:21:46 UTC

Internal Links: 1574405

Description Florian Weimer 2017-08-22 13:34:11 UTC
Currently, glibc accepts invalid IPv6 addresses, such as:

::%
::%-1
2001:db8::1%037777777777
2001:db8::00001

This is because invalid scope IDs and leading zeros in the address are not rejected.

This has been fixed upstream as part of bug 20611 and 16637.

Comment 1 Florian Weimer 2017-09-27 09:55:22 UTC
I think the change in parsing scope IDs carries very little risk and we should implement it.

I'm still undecided about the leading zeros change.  Many implementations reject such officially invalid IPv6 addresses: NSPR, various Perl, JQuery and Apache Commons validators, and the ip4r extension for PostgreSQL.

However, OpenJDK accepts them because their Java implementation is derived from the same inet_pton6 function originally found in BIND 4.9.4 (so it has the same bug).

ip6tables uses the glibc parser as well, so the change could cause ip6tables to reject invalid IPv6 addresses with an error message which would have previously been accepted.

Comment 2 Carlos O'Donell 2017-09-27 20:31:58 UTC
(In reply to Florian Weimer from comment #1)
> I think the change in parsing scope IDs carries very little risk and we
> should implement it.
> 
> I'm still undecided about the leading zeros change.  Many implementations
> reject such officially invalid IPv6 addresses: NSPR, various Perl, JQuery
> and Apache Commons validators, and the ip4r extension for PostgreSQL.
> 
> However, OpenJDK accepts them because their Java implementation is derived
> from the same inet_pton6 function originally found in BIND 4.9.4 (so it has
> the same bug).
> 
> ip6tables uses the glibc parser as well, so the change could cause ip6tables
> to reject invalid IPv6 addresses with an error message which would have
> previously been accepted.

Without enough data I think we should lean towards being liberal in what we accept.

Eventually the upstream parser, as it is, will enter the next major release of RHEL, where expectations can be set more clearly about the strictness of the parser.

Comment 3 Florian Weimer 2017-09-29 16:16:37 UTC
(In reply to Carlos O'Donell from comment #2)
> Without enough data I think we should lean towards being liberal in what we
> accept.

Agreed.  With the version I intend to commit, 2001:db8::00001 is accepted, but 2001:db8::1%037777777777 is rejected.  I think this is a reasonable compromise.

Comment 18 errata-xmlrpc 2018-04-10 14:00:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0805


Note You need to log in before you can comment on or make changes to this bug.