Skip to content

Commit f873ed6

Browse files
committed
docs(openapi): correct converter comment about runtime SSRF coverage
Earlier comment claimed the runtime ``ensure_secure_url`` in ``call_tool`` "already blocks the request" for loopback-redirect SSRF. That is wrong. ``ensure_secure_url`` allows ``http://`` to literal loopback hosts as a legitimate localhost-dev case, so a remote spec declaring ``servers[0].url = http://127.0.0.1:9090`` slips through the runtime gate and reaches the loopback service. Reword the comment to make the actual coverage split explicit: the runtime check catches non-loopback internal addresses (cloud metadata, RFC1918 ranges); the conversion-time check is the *only* defense for the attacker-controlled-loopback case because the spec's origin is the sole signal that distinguishes it from a legitimate localhost call, and that information only exists at conversion time. No behavior change.
1 parent 3a50250 commit f873ed6

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

plugins/communication_protocols/http/src/utcp_http/openapi_converter.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -155,17 +155,9 @@ def convert(self) -> UtcpManual:
155155
elif self.spec.get("servers"):
156156
base_url = self.spec["servers"][0].get("url", "/")
157157

158-
# Defense in depth against issue #83 / GHSA-39j6-4867-gg4w:
159-
# a remote OpenAPI spec must not be allowed to redirect tool
160-
# invocation at the agent's own loopback interface (cloud
161-
# metadata, internal admin panels, etc.). The runtime check in
162-
# call_tool already blocks the request, but rejecting at
163-
# conversion time produces a clearer error and prevents the
164-
# malicious tools from ever entering the registry.
165-
#
166-
# We only reject when the *spec was fetched from a non-loopback
167-
# source*. A user pointing the converter at their own
168-
# localhost OpenAPI spec is allowed to declare loopback
158+
# Rule: a spec fetched from a non-loopback source cannot declare
159+
# a loopback server URL. A user pointing the converter at their
160+
# own localhost OpenAPI spec is allowed to declare loopback
169161
# servers, and an explicit ``base_url`` override always wins
170162
# (handled above).
171163
if (

0 commit comments

Comments
 (0)