Описание When StormCrawler выбирает хост /robots.txt и получает перенаправление, HttpRobotRulesParser разрешает заголовок Location и повторно выбирает цель для пяти переходов. Цикл не проверяет ни схему, ни хост, ни порт разрешенной цели, и он не регулируется http.allow.redirects, что влияет только на выборку страницы. Таким образом, сканируемый сайт может указать robots.txt по любому адресу, доступному для пользователя, включая интерфейсы обратной связи, частные диапазоны и конечные точки облачных метаданных.
Каждый сканируемый URL вызывает выборку robots.txt при промахе кэша, поэтому для достижения цикла не требуется никакой необычной конфигурации. Полученное тело разбирается только как правила роботов и не возвращается вызывающему абоненту, поэтому само чтение является слепым. Более прямое влияние на учетные данные: протокол okhttp применяет свои настроенные заголовки запросов, включая заголовки Authorization, построенные из http.basicauth.user и http.basicauth.password, и все, что находится в http.custom.headers, к каждому запросу, который он делает.
Поскольку StormCrawler следует за самим перенаправлением и выдает новый запрос, собственное удаление HTTP заголовка Authorization через изменение хоста не применяется, и учетные данные сканирования оператора доставляются хосту имена перенаправления. Фильтр IP времени соединения, http.filter.ipaddress.include и http.filter.ipaddress.exclude, устанавливается в качестве перехватчика сети okhttp на том же клиенте и применяется к этим переходам, когда он настроен. Он поставляется без правил, поэтому путь доступен в конфигурации по умолчанию.
Фильтрация URL никогда не применяется, потому что выборка robots.txt не проходит через цепочку фильтров Outlink. Смягчение Upgrade до 4.0.0, где перенаправление robots.txt выполняется только тогда, когда цель использует http или https и разделяет схему, хост и порт с URL, с которого он был достигнут. Развертывания, которые законно обслуживают robots.txt через перекрестное перенаправление хоста, могут восстановить предыдущее поведение с помощью http.robots.redirect.crosshost.allow.
Пользователи, которые не могут обновиться сразу, должны установить http.filter.ipaddress.exclude для охвата диапазонов циклической, частной, локальной ссылки и CGNAT, который применяется после разрешения DNS и, следовательно, также на перенаправление. Операторы, которые настраивают http.basicauth.* или http.custom.headers для сканирования, должны предположить, что эти учетные данные могли быть отправлены сторонним хостам и вращать их, и должны охватывать учетные данные, запустив отдельную топологию для источника. Кредит Independently сообщил Apache StormCrawler PMC n0mi1k, с доказательством концепции.
Также найдено ASF - с использованием агентов Claude для изучения безопасности проектов с открытым исходным кодом, подтвержденных и сообщенных Apache StormCrawler.
Показать оригинальное описание (EN)
Description When StormCrawler fetches a host's `/robots.txt` and receives a redirect, `HttpRobotRulesParser` resolves the `Location` header and re-fetches the target for up to five hops. The loop checks neither the scheme, the host nor the port of the resolved target, and it is not governed by `http.allow.redirects`, which only affects the page fetch. A crawled site can therefore point the robots.txt fetch at any address reachable from the fetcher worker, including loopback interfaces, private ranges and cloud metadata endpoints. Every crawled URL triggers a robots.txt fetch on a cache miss, so no unusual configuration is required to reach the loop. The fetched body is only parsed as robots rules and is not returned to the caller, so the read itself is blind. The more direct impact is on credentials: the okhttp protocol applies its configured request headers, including the `Authorization` header built from `http.basicauth.user` and `http.basicauth.password` and anything in `http.custom.headers`, to every request it makes. Because StormCrawler follows the redirect itself and issues a new request, okhttp's own removal of the `Authorization` header across a host change does not apply, and the operator's crawl credentials are delivered to the host the redirect names. The connection-time IP filter, `http.filter.ipaddress.include` and `http.filter.ipaddress.exclude`, is installed as an okhttp network interceptor on the same client and does apply to these hops when it is configured. It ships with no rules, which is why the path is reachable in a default configuration. URL filtering never applies, because the robots.txt fetch does not pass through the outlink filter chain. Mitigation Upgrade to 4.0.0, where a robots.txt redirect is followed only when the target uses http or https and shares scheme, host and port with the URL it was reached from. Deployments that legitimately serve robots.txt through a cross-host redirect can restore the previous behaviour with `http.robots.redirect.crosshost.allow`. Users who cannot upgrade immediately should set `http.filter.ipaddress.exclude` to cover loopback, private, link-local and CGNAT ranges, which is enforced after DNS resolution and therefore also on redirect hops. Operators who configure `http.basicauth.*` or `http.custom.headers` for a crawl should assume those credentials may have been sent to third-party hosts and rotate them, and should scope credentials by running a separate topology per origin. Credit Independently reported to the Apache StormCrawler PMC by n0mi1k, with a proof of concept. Also found by the ASF -- using Claude agents to study the security of open-source projects, validated and reported by Apache StormCrawler.