]> git.ipfire.org Git - thirdparty/squid.git/commit
Bug 5520: ERR_INVALID_URL for CONNECT host with leading digit (#2283)
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 23 Oct 2025 08:05:28 +0000 (08:05 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Thu, 23 Oct 2025 08:46:13 +0000 (08:46 +0000)
commit85b9d6d92057c1185c1ab883c550a01347b1c02e
treea1a0a67ffb7fcfdda32093adf34a30044d3a30c0
parent3319d8731340f2ea4358d1297f423ef22856a1a1
Bug 5520: ERR_INVALID_URL for CONNECT host with leading digit (#2283)

Squid 7.2 commit b8337359 added validation of host names
following RFC 1035 requirements. But those requirements were
outdated by RFC 1123:

  One aspect of host name syntax is hereby changed: the
  restriction on the first character is relaxed to allow either a
  letter or a digit.  Host software MUST support this more liberal
  syntax.

The commit treated CONNECT host names that start with a decimal digit
as invalid IPv4 addresses and rejected the corresponding requests,
resulting in HTTP 404 errors. Undo that change.

We have considered preserving code that detects valid IPv4 addresses (as
opposed to treating all non-IPv6 input as an "IPv4 address or reg-name"
without disambiguating the two cases) because its pieces may be reused,
but that essentially unused code has non-trivial performance penalty and
final code may look quite different after we complete our "non-CONNECT
uri-host parsing code" migration TODO. Polished source code comments
aside, this change reverts 2025 commit b8337359 and restores 2023
AnyP::Uri::parseHost() implementation (commit 963ff143).
src/anyp/Uri.cc