CVE-2026-141557: Potato SSRF Protection Vulnerability

MODERATE
Advisory Identifier: GHSA-hh7f-fmp2-c679
CVSS 4.3
CWE-918
Published
Advisory Summary

CVE-2026-141557 is a MODERATE (CVSS 4.3) ssrf protection vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Potato libraries in the PyPI ecosystem. The issue involves ssrf protection in /api/web_agent/proxy can be bypassed with a redirect or a backslash in the url. Remediation is available by upgrading affected packages to version 2.14.1.

CVE-2026-141557 at a Glance

CVE Identifier CVE-2026-141557
GHSA Identifier GHSA-hh7f-fmp2-c679
Severity MODERATE
CVSS v3.1 Base Score 4.3
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Potato
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 4.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-141557

To remediate this vulnerability, upgrade all affected Potato dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

potato-annotation fixed: 2.14.1
pip install potato-annotation>=2.14.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show potato-annotation

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-141557, inspect your installed packages using pip:

pip show potato-annotation

Analyze the terminal output to locate any version of Potato in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.14.1), your application is affected.

Note: The pip show potato-annotation command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Potato, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary When a task config uses the `web_agent_trace` or `web_agent_recorder` display type, Potato registers a web proxy at `/api/web_agent/proxy/<url>` for logged-in annotators. The proxy is meant to refuse private and loopback addresses, and it does return 403 for `http://127.0.0.1:8080/`. Two kinds of input get past that check, and the proxy returns the internal response to the caller: 1. A public URL that answers with a redirect to an internal address. The hostname is checked once and `requests` follows the redirect. 2. A URL like `http://127.0.0.1:8080\@x.invalid/../latest/meta-data/iam`. The check resolves `x.invalid`, the lookup fails, and the check allows it. `requests` then connects to `127.0.0.1:8080` and requests `/latest/meta-data/iam`. GHSA-9394 fixed `/api/audio/proxy` by moving it to `server_utils/url_guard.fetch`, but the web proxy still uses its own validator. The `url_guard.py` module docstring already notes that this validator allows names it cannot resolve and does not check redirects. ### Details Code references are to 2.14.0. `potato/web_proxy.py` on master has the same git blob (53d0c48) as the 2.14.0 tag. - The blueprint is registered when a config has an `instance_display` field of type `web_agent_trace` or `web_agent_recorder` (`flask_server.py:5916-5933`). The example `examples/agent-traces/web-agent-review/config.yaml` does this. - `proxy()` requires a logged-in session or a proxy token (`web_proxy.py:134-136`). `user_config.allow_all_users` defaults to true, so while open enrolment stays on and local registration is allowed (it is refused in SSO-only setups), anyone who can reach the site can register an annotator account with `POST /register`. - `_validate_url` (`web_proxy.py:106-122`) takes `urlparse(url).hostname` and passes it to `_is_private_ip` (`:80-103`). That function calls `getaddrinfo` once and returns "not private" on `socket.gaierror` (`:99-101`). - The fetch is `requests.get(target_url, ..., allow_redirects=True)` (`:177-183`). The body is returned for every content type (`:189-203`). Redirect: only the first URL is checked. A 302 from an allowed host to `http://127.0.0.1:...` or `http://169.254.169.254/...` is followed without another check. Backslash: `urllib.parse.urlparse` ends the authority only at `/`, `?` or `#`, so for `http://127.0.0.1:8080\@x.invalid/...` the hostname it reports is `x.invalid`. That name does not resolve, so the check passes. urllib3, which `requests` uses, ends the authority at the backslash, so the connection goes to `127.0.0.1:8080`. urllib3 also removes dot segments, so `\@x.invalid/../latest/meta-data/iam` becomes the path `/latest/meta-data/iam`. No attacker server is needed for this variant. `/api/web_agent/check_frameable` uses the same validator with `requests.head(..., allow_redirects=True)` (`:233-274`). It returns no body, and I have not tested it. ### PoC Tested on potato-annotation 2.14.0 and 2.4.0, each installed with pip from PyPI into a clean venv (Python 3.12.16, requests 2.34.2, urllib3 2.8.0). Each run used a fresh container with no network. The internal target is a small HTTP server bound to `127.0.0.1:8080` on the potato host. The potato server runs a copy of `examples/agent-traces/web-agent-review/config.yaml` (which sets `allow_all_users: true`). ``` anonymous, no session: direct internal -> HTTP 302 (redirect to /login) self-registered annotator 'mallory_nodns_1795794814': HTTP 200, session cookie set: True annotator: direct http://127.0.0.1:8080/ (control) -> HTTP 403 ...Requests to private/internal addresses are not allowed. annotator: http://127.0.0.1:8080\@x.invalid/... -> HTTP 200 INTERNAL-ONLY-SECRET token=s3cr3t-6f1c path=/%5C@x.invalid/latest/meta-data/ annotator: http://127.0.0.1:8080\@x.invalid/../latest/... -> HTTP 200 INTERNAL-ONLY-SECRET token=s3cr3t-6f1c path=/latest/meta-data/iam ``` Requests sent (the backslash is sent as `%5C`, the `..` as `%2E%2E`): ``` POST /register email=mallory&pass=... GET /api/web_agent/proxy/http://127.0.0.1:8080%5C@x.invalid/%2E%2E/latest/meta-data/iam ``` For the redirect variant the container has no public addresses, so the test launcher makes the single name `attacker.test` resolve to a public IP and routes that IP to a local server that returns `302 Location: http://127.0.0.1:8080/latest/meta-data/`. Potato's code is not modified; the redirect is followed by `requests` inside the unmodified proxy: ``` annotator: direct http://127.0.0.1:8080/ (control) -> HTTP 403 ... [attacker.test] got /r -> 302 http://127.0.0.1:8080/latest/meta-data/ annotator: http://attacker.test/r (302 to internal) -> HTTP 200 INTERNAL-ONLY-SECRET token=s3cr3t-6f1c path=/latest/meta-data/ ``` Both variants give the same result on 2.4.0. 2.3.0 does not contain `web_proxy.py`; releases between 2.4.0 and 2.14.0 were not run, but the validator and `allow_redirects=True` are the same in the tags I read (v2.4.0, v2.13.1, v2.14.0). The driver and launcher scripts are available on request. ### Impact On a deployment that enables the web agent display types, any annotator account can make the Potato server send GET requests to loopback and internal addresses and read the responses. With open enrolment, that means anyone who can reach the site. What this exposes depends on what the server can reach, for example local admin interfaces or internal HTTP APIs, and on a cloud host possibly the instance metadata service. I only read a test service, so the score uses C:L. If a reachable internal service returns credentials or other sensitive data, C:H (6.5) would fit better. ### Suggested fix One option is to fetch through `potato.server_utils.url_guard.fetch` in `proxy()`. Per its docstring and the code in `fetch()`, `url_guard` fails closed on unresolvable names, connects to the address it validated, and checks every redirect hop. It rebuilds the URL from the validated address, which should also cover the backslash case. `check_frameable()` needs the same per-hop handling; `fetch()` issues GET, so keeping a HEAD request there needs a small addition, and calling only `url_guard.validate_url` would leave `allow_redirects=True` in place. A regression test could assert that `http://127.0.0.1:<port>\@x.invalid/` and a redirect to `127.0.0.1` are rejected and that the internal listener receives no request.

CVE-2026-141557 Affected Potato Versions

1 component(s)
Fixed Versions:
2.14.1
Product / Package Ecosystem Affected Versions Fixed Version
potato-annotation
PyPI
≥ 2.4.0
< 2.14.1
2.14.1

References

Frequently Asked Questions

What is CVE-2026-141557?
CVE-2026-141557 is a security vulnerability in Potato involving SSRF protection in /api/web_agent/proxy can be bypassed with a redirect or a backslash in the URL under CWE-918: Server-Side Request Forgery (SSRF).
Which Potato versions are affected?
Affected versions include releases prior to 2.14.1 across affected packages: potato-annotation.
What version fixes CVE-2026-141557?
Upgrading to 2.14.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is potato-annotation affected?
Yes, potato-annotation is affected in releases prior to 2.14.1. Upgrade your dependency to 2.14.1 or later.
What is the CVSS score of CVE-2026-141557?
CVE-2026-141557 has a CVSS v3.1 base score of 4.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2026-141557?
CVE-2026-141557 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check PyPI dependencies for CVE-2026-141557?
Run the dependency tree command: 'pip show potato-annotation'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hh7f-fmp2-c679",
  "modified" : "2026-12-04T21:51:09Z",
  "published" : "2026-12-04T21:51:09Z",
  "aliases" : [ "CVE-2026-141557" ],
  "summary" : "Potato: SSRF protection in /api/web_agent/proxy can be bypassed with a redirect or a backslash in the URL",
  "details" : "### Summary\n\nWhen a task config uses the `web_agent_trace` or `web_agent_recorder` display type, Potato registers a web proxy at `/api/web_agent/proxy/<url>` for logged-in annotators. The proxy is meant to refuse private and loopback addresses, and it does return 403 for `http://127.0.0.1:8080/`. Two kinds of input get past that check, and the proxy returns the internal response to the caller:\n\n1. A public URL that answers with a redirect to an internal address. The hostname is checked once and `requests` follows the redirect.\n2. A URL like `http://127.0.0.1:8080\\@x.invalid/../latest/meta-data/iam`. The check resolves `x.invalid`, the lookup fails, and the check allows it. `requests` then connects to `127.0.0.1:8080` and requests `/latest/meta-data/iam`.\n\nGHSA-9394 fixed `/api/audio/proxy` by moving it to `server_utils/url_guard.fetch`, but the web proxy still uses its own validator. The `url_guard.py` module docstring already notes that this validator allows names it cannot resolve and does not check redirects.\n\n### Details\n\nCode references are to 2.14.0. `potato/web_proxy.py` on master has the same git blob (53d0c48) as the 2.14.0 tag.\n\n- The blueprint is registered when a config has an `instance_display` field of type `web_agent_trace` or `web_agent_recorder` (`flask_server.py:5916-5933`). The example `examples/agent-traces/web-agent-review/config.yaml` does this.\n- `proxy()` requires a logged-in session or a proxy token (`web_proxy.py:134-136`). `user_config.allow_all_users` defaults to true, so while open enrolment stays on and local registration is allowed (it is refused in SSO-only setups), anyone who can reach the site can register an annotator account with `POST /register`.\n- `_validate_url` (`web_proxy.py:106-122`) takes `urlparse(url).hostname` and passes it to `_is_private_ip` (`:80-103`). That function calls `getaddrinfo` once and returns \"not private\" on `socket.gaierror` (`:99-101`).\n- The fetch is `requests.get(target_url, ..., allow_redirects=True)` (`:177-183`). The body is returned for every content type (`:189-203`).\n\nRedirect: only the first URL is checked. A 302 from an allowed host to `http://127.0.0.1:...` or `http://169.254.169.254/...` is followed without another check.\n\nBackslash: `urllib.parse.urlparse` ends the authority only at `/`, `?` or `#`, so for `http://127.0.0.1:8080\\@x.invalid/...` the hostname it reports is `x.invalid`. That name does not resolve, so the check passes. urllib3, which `requests` uses, ends the authority at the backslash, so the connection goes to `127.0.0.1:8080`. urllib3 also removes dot segments, so `\\@x.invalid/../latest/meta-data/iam` becomes the path `/latest/meta-data/iam`. No attacker server is needed for this variant.\n\n`/api/web_agent/check_frameable` uses the same validator with `requests.head(..., allow_redirects=True)` (`:233-274`). It returns no body, and I have not tested it.\n\n### PoC\n\nTested on potato-annotation 2.14.0 and 2.4.0, each installed with pip from PyPI into a clean venv (Python 3.12.16, requests 2.34.2, urllib3 2.8.0). Each run used a fresh container with no network. The internal target is a small HTTP server bound to `127.0.0.1:8080` on the potato host. The potato server runs a copy of `examples/agent-traces/web-agent-review/config.yaml` (which sets `allow_all_users: true`).\n\n```\nanonymous, no session: direct internal                     -> HTTP 302  (redirect to /login)\nself-registered annotator 'mallory_nodns_1795794814': HTTP 200, session cookie set: True\nannotator: direct http://127.0.0.1:8080/ (control)         -> HTTP 403  ...Requests to private/internal addresses are not allowed.\nannotator: http://127.0.0.1:8080\\@x.invalid/...            -> HTTP 200  INTERNAL-ONLY-SECRET token=s3cr3t-6f1c path=/%5C@x.invalid/latest/meta-data/\nannotator: http://127.0.0.1:8080\\@x.invalid/../latest/...  -> HTTP 200  INTERNAL-ONLY-SECRET token=s3cr3t-6f1c path=/latest/meta-data/iam\n```\n\nRequests sent (the backslash is sent as `%5C`, the `..` as `%2E%2E`):\n\n```\nPOST /register                          email=mallory&pass=...\nGET  /api/web_agent/proxy/http://127.0.0.1:8080%5C@x.invalid/%2E%2E/latest/meta-data/iam\n```\n\nFor the redirect variant the container has no public addresses, so the test launcher makes the single name `attacker.test` resolve to a public IP and routes that IP to a local server that returns `302 Location: http://127.0.0.1:8080/latest/meta-data/`. Potato's code is not modified; the redirect is followed by `requests` inside the unmodified proxy:\n\n```\nannotator: direct http://127.0.0.1:8080/ (control)         -> HTTP 403  ...\n[attacker.test] got /r -> 302 http://127.0.0.1:8080/latest/meta-data/\nannotator: http://attacker.test/r (302 to internal)        -> HTTP 200  INTERNAL-ONLY-SECRET token=s3cr3t-6f1c path=/latest/meta-data/\n```\n\nBoth variants give the same result on 2.4.0. 2.3.0 does not contain `web_proxy.py`; releases between 2.4.0 and 2.14.0 were not run, but the validator and `allow_redirects=True` are the same in the tags I read (v2.4.0, v2.13.1, v2.14.0). The driver and launcher scripts are available on request.\n\n### Impact\n\nOn a deployment that enables the web agent display types, any annotator account can make the Potato server send GET requests to loopback and internal addresses and read the responses. With open enrolment, that means anyone who can reach the site. What this exposes depends on what the server can reach, for example local admin interfaces or internal HTTP APIs, and on a cloud host possibly the instance metadata service. I only read a test service, so the score uses C:L. If a reachable internal service returns credentials or other sensitive data, C:H (6.5) would fit better.\n\n### Suggested fix\n\nOne option is to fetch through `potato.server_utils.url_guard.fetch` in `proxy()`. Per its docstring and the code in `fetch()`, `url_guard` fails closed on unresolvable names, connects to the address it validated, and checks every redirect hop. It rebuilds the URL from the validated address, which should also cover the backslash case. `check_frameable()` needs the same per-hop handling; `fetch()` issues GET, so keeping a HEAD request there needs a small addition, and calling only `url_guard.validate_url` would leave `allow_redirects=True` in place. A regression test could assert that `http://127.0.0.1:<port>\\@x.invalid/` and a redirect to `127.0.0.1` are rejected and that the internal listener receives no request.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "potato-annotation"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.4.0"
      }, {
        "fixed" : "2.14.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.14.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/davidjurgens/potato/security/advisories/GHSA-hh7f-fmp2-c679"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-141557"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/davidjurgens/potato/commit/4e6f4d8c4a2160cdea6cafe0c0ec58badc4ce18d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/davidjurgens/potato"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/davidjurgens/potato/releases/tag/v2.14.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-12-04T21:51:09Z",
    "nvd_published_at" : "2026-12-02T21:18:11Z"
  }
}