fix(web): re-check Firecrawl final URLs for SSRF (salvage #35840) - #56143
Merged
Merged
Conversation
Follow-up for salvaged PR #35840: current main removed the use_llm_processing kwarg (LLM summarization dropped) and moved the input SSRF gate to async_is_safe_url. Adjust the new firecrawl-final-url test to match.
Contributor
2 tasks
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Firecrawl's reported final URL (
metadata.sourceURL) is now SSRF-checked withis_safe_url()before any scraped content is returned — closing a redirect-based SSRF hole whereweb_extractvalidated the input URL but not the post-fetch redirect target (e.g.169.254.169.254cloud metadata).Salvage of #35840 by @zapabob — original commit cherry-picked with authorship preserved.
Changes
plugins/web/firecrawl/provider.py: re-runis_safe_url(final_url)right before the existing website-policy re-check; fail-closed, returns an empty blocked result.tests/tools/test_website_policy.py: regression test for a Firecrawl final URL pointing at the cloud metadata endpoint; adapt to currentweb_extract_toolsignature (async_is_safe_urlinput gate, nouse_llm_processingkwarg).Root cause
The input URL is SSRF-gated at the
web_extract_toolentry (async_is_safe_url), but the final-URL path only re-rancheck_website_access— not the SSRF guard. A redirect to a private/metadata address slipped past.Scope
The sibling
plugins/browser/firecrawlprovider has no redirect/final-URL surface, so no matching site there — the bug class is complete with this one change.Validation
tests/tools/test_website_policy.pyInfographic