Potato: SSRF protection in /api/web_agent/proxy can be bypassed with a redirect or a backslash in the URL
Original description The description as published by the source.
Potato is a portable annotation tool. From 2.4.0 until 2.14.1, deployments using the web_agent_trace or web_agent_recorder display type expose /api/web_agent/proxy/ to a logged-in annotator or a holder of a proxy token. In potato/web_proxy.py, _validate_url passes urlparse(url).hostname to _is_private_ip, which uses getaddrinfo once and allows a socket.gaierror lookup failure. The proxy follows redirects without checking the destination, allowing a public URL to redirect to a private or loopback service. A URL containing a backslash in its authority can also be interpreted differently by the validator and the HTTP client, causing a connection to an internal address after the failed hostname lookup is allowed. An annotator can read the internal response, and open enrollment with local registration can make an annotator account available to anyone who can reach the deployment. This issue is fixed in version 2.14.1.
Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
References
- advisory github.com
- advisory github.com
- advisory nvd.nist.gov
- patch github.com
- web github.com