The vulnerability is a Server-Side Request Forgery (SSRF) within the URL scraping functionality of Aider. The core issue was that user-supplied URLs were not being validated to ensure they did not point to private or reserved network addresses, such as the AWS EC2 metadata endpoint (169.254.169.254) or other internal services. The main Scraper.scrape function would receive a malicious URL and pass it to either Scraper.scrape_with_httpx or Scraper.scrape_with_playwright.
In the case of scrape_with_httpx, the httpx.get call would directly make a request to the malicious URL. In the case of scrape_with_playwright, the headless browser would render a page that could itself trigger requests to internal services. The patch addresses this by implementing a robust validation mechanism. A new validate_url method was introduced, which resolves the domain name and checks if the resulting IP address is a public, unicast address. This check is now performed at the beginning of the scrape function, within the scrape_with_httpx redirect-following loop, and for every single request made by the Playwright browser, effectively closing the SSRF vector.