You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bounty Proposal: Sanitize Unexpected Exception Leakage in Web Retrieval Tool #19617
Following the contribution guide's invitation to propose paid work — @kodjima33, @josancamon19, @aryanorastar, would a US$50 bounty be appropriate for this? Proposed amount, not an existing award.
This addresses security hardening on the web retrieval tool to eliminate internal infrastructure and exception disclosure:
The complete fix and hermetic unit test suite are implemented and verified in PR #19616.
Problem & Vulnerability
In backend/utils/retrieval/tools/web_tools.py:
In fetch_url_tool, unexpected exceptions during page fetching were formatted directly into the tool return string:
exceptExceptionase:
logger.error(f"fetch_url_tool - error fetching {sanitize(url)}: {sanitize(str(e))}")
returnf'Error: Failed to fetch the URL. {sanitize(str(e))}'
Any low-level network failure, connection timeout, DNS lookup failure, SSL error, proxy connection error, or connection pool exception leaked raw internal error strings, proxy addresses, ports, and internal socket details directly into the LLM prompt and agent context.
Sanitize Exception Details: Replaced raw {sanitize(str(e))} reflection in fetch_url_tool with a safe generic error message ('Error: Failed to fetch the URL. Please try again later.').
Server-Side Observability: Maintained structured logger.error logging on the backend for debugging without exposing internal details to callers or LLM prompts.
Preserve Validation Feedback: Ensured standard scheme and SSRF validation errors (ValueError) remain intact for legitimate user feedback.
Hermetic Unit Test Suite: Added backend/tests/unit/test_fetch_url_tool_sanitization.py validating that unexpected exceptions are safely masked and validation errors are preserved (2/2 passing).
Bounty Payout Destination (EVM - Base Mainnet): 0x496e32ff3851cdb9146223a811e3d4f9218dd954
Activity
aryanorastar commentedon Oct 2, 2026
Duplicate of #19407, the earlier open issue covering the same web retrieval exception text.