The security vulnerability is a Server-Side Request Forgery (SSRF) located in the fetch_url tool of the DeepSeek TUI application. The root cause of the vulnerability was the application's failure to validate HTTP redirect targets. The FetchUrlTool::run function would validate the initial URL against a blocklist of restricted IP addresses but then used an HTTP client configured to automatically follow up to five redirects. An attacker could exploit this by providing a legitimate-looking URL that would redirect to a sensitive internal endpoint, such as a cloud provider's metadata service (e.g., 169.254.169.254). Since the redirect target was never validated, the SSRF check was bypassed.
The patch, identified in commit 8b60275981940d09dd8b15b757b60fb7411f59ee, rectifies this flaw. It modifies the FetchUrlTool::run function to disable automatic redirects in the reqwest client (redirect::Policy::none()). Instead, it implements a manual loop to handle redirects. Within this loop, each new URL from a Location header is extracted and explicitly passed to a new validation function, validate_fetch_target, before any request is sent. This ensures that all URLs in a redirect chain are subject to the same SSRF and network policy checks, effectively closing the vulnerability.