You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2025/07/19 07:36:26 UTC
[Bug 69753] New: ProxyPass fails with an IPv6 literal including a scope identifier
https://bz.apache.org/bugzilla/show_bug.cgi?id=69753
Bug ID: 69753
Summary: ProxyPass fails with an IPv6 literal including a scope
identifier
Product: Apache httpd-2
Version: 2.4.64
Hardware: PC
OS: FreeBSD
Status: NEW
Severity: normal
Priority: P2
Component: mod_proxy_http
Assignee: bugs@httpd.apache.org
Reporter: lexi@le-fay.org
Target Milestone: ---
this configuration:
<Location />
ProxyPass "http://[fe80::2%vm.cgit]:80"
</Location>
generates this error:
AH01083: error parsing URL http://[fe80::2%vm.cgit]:80: Invalid host/port
using an IPv6 literal address without a scope identifier works fine, e.g.:
<Location />
ProxyPass "http://[fd00::1]:80"
</Location>
using a scope identifier is useful in some situations; in my case, Apache is
running on a FreeBSD systems where each service is in a jail, and the
link-local address is used to connect to the HTTP backend in the jail.
this could also be used to connect to VMs, etc. where a global address isn't
required.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 69753] ProxyPass fails with an IPv6 literal including a scope identifier
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69753
--- Comment #8 from Ruediger Pluem <rp...@apache.org> ---
>
> > CONNECT to a forward proxy I guess the authority string used *should*
> > include the scope ID if one has been configured, but that is pretty hairy
> > territory.
>
> Agreed and I think these are edge cases as scope id's are only valid for
> link local addresses to my understanding.
>
Scratch the edge case. It is a regular case.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 69753] ProxyPass fails with an IPv6 literal including a scope identifier
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69753
--- Comment #3 from Joe Orton <jo...@redhat.com> ---
Seems to date back to here:
https://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/proxy_util.c?pathrev=103698&r1=103698&r2=103697#properties
I would guess the simple alternative there would be to silently ignore a
non-NULL scope_id, which is definitely worse than the status quo.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 69753] ProxyPass fails with an IPv6 literal including a scope identifier
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69753
--- Comment #6 from Joe Orton <jo...@redhat.com> ---
If the server hostname is an IP literal, does that end up going through the DNS
resolver in the proxy code already? If so, yes, that would break.
On the wire the hostname used will (almost?) always be the authority string
parsed without the scope, e.g. in a outgoing Host: header. For an outgoing
CONNECT to a forward proxy I guess the authority string used *should* include
the scope ID if one has been configured, but that is pretty hairy territory.
The proper way to handle this is likely to parse/store/generate the authority
string separately to the parsed (struct sockaddr) for an IP literal (which
includes the parsed scope), or a DNS-name.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 69753] ProxyPass fails with an IPv6 literal including a scope identifier
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69753
--- Comment #4 from Joe Orton <jo...@redhat.com> ---
Though I note Jens says: "using an IPv6 literal address without a scope
identifier works fine"
So actually maybe it's not worse. I guess if the address is ambiguous without a
scope, you get an error from connect() anyway. On Linux that appears to be
true.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 69753] ProxyPass fails with an IPv6 literal including a scope identifier
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69753
--- Comment #5 from Ruediger Pluem <rp...@apache.org> ---
(In reply to Joe Orton from comment #4)
> Though I note Jens says: "using an IPv6 literal address without a scope
> identifier works fine"
>
> So actually maybe it's not worse. I guess if the address is ambiguous
> without a scope, you get an error from connect() anyway. On Linux that
> appears to be true.
I guess if we add the scope id to the addr string we get some trouble with DNS
resolution later as it cannot deal with it?
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 69753] ProxyPass fails with an IPv6 literal including a scope identifier
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69753
--- Comment #7 from Ruediger Pluem <rp...@apache.org> ---
(In reply to Joe Orton from comment #6)
> If the server hostname is an IP literal, does that end up going through the
> DNS resolver in the proxy code already? If so, yes, that would break.
Hm, we seem to use apr_sockaddr_info_get for doing the DNS resolution, which on
Linux seems to use getaddrinfo where the man page states:
getaddrinfo() supports the address%scope-id notation for specifying the IPv6
scope-ID.
I haven't checked if this would really work on Linux let alone for other OS
especially Windows.
>
> On the wire the hostname used will (almost?) always be the authority string
> parsed without the scope, e.g. in a outgoing Host: header. For an outgoing
Agreed.
> CONNECT to a forward proxy I guess the authority string used *should*
> include the scope ID if one has been configured, but that is pretty hairy
> territory.
Agreed and I think these are edge cases as scope id's are only valid for link
local addresses to my understanding.
>
> The proper way to handle this is likely to parse/store/generate the
> authority string separately to the parsed (struct sockaddr) for an IP
> literal (which includes the parsed scope), or a DNS-name.
This looks like a way forward that we store the scope id separately and add it
back in places where needed. I just don't see immediately how we could extend
the existing data structures to do this and fit this into the existing flow.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 69753] ProxyPass fails with an IPv6 literal including a scope identifier
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69753
--- Comment #2 from Ruediger Pluem <rp...@apache.org> ---
(In reply to Jens Finkhaeuser from comment #1)
> I've been digging around a little...
>
> The offending line is proxy_util.c 397.
>
Does someone remember or has an idea why an existing scope_id in
https://github.com/apache/httpd/blob/b917376bdb0a1fc749cab3f1b96ae1e1aea0e253/modules/proxy/proxy_util.c#L406-L409
is considered to be a failure?
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 69753] ProxyPass fails with an IPv6 literal including a scope identifier
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69753
--- Comment #1 from Jens Finkhaeuser <je...@finkhaeuser.de> ---
I've been digging around a little...
The offending line is proxy_util.c 397.
If a scope zone identifier can be parsed, it treats this as an error.
The fix is going to be a little larger, as even if this were not treated as an
error, the identifier would be discarded here - it'd need to be passed out, and
*used* where necessary.
FWIW, in the course of this, I found that apr-util's apr_uri_parse() and
apr_uri_unparse() do not respect RFC6874's format for specifying zone
identifiers in URIs.
I'm not sure how relevant that is here, because mod_proxy mixes apr_uri_parse()
with its own ap_proxy_canon_netloc() in ways I don't have time to follow up.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 69753] ProxyPass fails with an IPv6 literal including a scope identifier
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69753
Jens Finkhaeuser <je...@finkhaeuser.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Depends on| |69754
Referenced Bugs:
https://bz.apache.org/bugzilla/show_bug.cgi?id=69754
[Bug 69754] apr_uri_parse()/apr_uri_unparse() do not deal with RFC6874 scope
zone identifiers
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org