Skip to content

Keep the fetcher off private address space by default - #2127

Open
abhinav-phi wants to merge 1 commit into
apache:mainfrom
abhinav-phi:issue-2080-private-address-default
Open

Keep the fetcher off private address space by default#2127
abhinav-phi wants to merge 1 commit into
apache:mainfrom
abhinav-phi:issue-2080-private-address-default

Conversation

@abhinav-phi

Copy link
Copy Markdown
Contributor

Fixes #2080.

The connection-time IP filter was the only check that looked at the address the fetcher actually connects to, and both of its keys shipped commented out in crawler-default.yaml, so at defaults the interceptor was never installed. The regex exclusion list in the archetypes matched literal localhost and four dotted-quad ranges and nothing else — link-local, CGNAT, IPv6 unique-local and the abbreviated and integer IPv4 forms the JVM resolver maps to 127.0.0.1 all passed it, and InetAddress.getByName maps 127.1 and 2130706433 to loopback without any DNS control.

  • crawler-default.yaml ships http.filter.ipaddress.exclude enabled: localhost,sitelocal,linklocal,100.64.0.0/10,fd00::/8. A fetched page decides which hosts the fetcher connects to, and these ranges host unauthenticated services (e.g. cloud instance metadata at 169.254.169.254, reachable whatever DNS name a link used, since the check runs on the resolved socket address) which a public index must not leak into
  • crawling an intranet or a loopback service needs an explicit opt-out — the comment next to the key documents how
  • the archetype default-regex-filters.txt (and its opensearch/solr copies) gains rules for 169.254.0.0/16, 100.64.0.0/10, 0.0.0.0/8, IPv6 fc00::/7 and fe80::/10, abbreviated loopback (127.1) and integer IPv4 hosts (2130706433), and states that a regex list judges the bytes of the URL only — it can never enforce where a host name resolves, so the IP filter stays the authoritative check

Release note needed: enabling the exclude list by default changes behaviour for anyone crawling an intranet or a loopback service; the way to opt out is documented next to the key.

The IP address filter was the only check that looked at the address the
fetcher actually connects to, and both of its keys shipped commented
out, so the interceptor was never installed at library defaults. The
regex exclusion list in the archetypes matched literal localhost and
four dotted-quad ranges and nothing else: link-local, CGNAT, IPv6
unique-local and the abbreviated and integer IPv4 forms the resolver
maps to 127.0.0.1 all passed it.

- crawler-default.yaml ships http.filter.ipaddress.exclude enabled
  (loopback, RFC1918, link-local, CGNAT, IPv6 unique-local); a fetched
  page decides which hosts the fetcher connects to, and these ranges
  host unauthenticated services a public index must not leak into.
  Crawling an intranet needs an explicit opt-out, documented in the
  comment next to the key
- the archetype default-regex-filters.txt (and its opensearch/solr
  copies) gains rules for 169.254.0.0/16, 100.64.0.0/10, 0.0.0.0/8,
  IPv6 fc00::/7 and fe80::/10, the abbreviated loopback forms (127.1)
  and integer IPv4 hosts (2130706433), and says in its comment that a
  regex list judges the bytes of the URL only, so the IP filter stays
  the authoritative check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nothing in the shipped configuration keeps the fetcher off private address space

1 participant