SSRF in @frontmcp/plugin-skilled-openapi executor via IPv4-mapped-IPv6 hex-form guard bypass
Description
SSRF in @frontmcp/plugin-skilled-openapi executor via IPv4-mapped-IPv6 hex-form guard bypass
Summary
@frontmcp/plugin-skilled-openapi runs bundle-declared REST operations at request time and protects every outbound call with a first-party SSRF guard in plugins/plugin-skilled-openapi/src/executor/ssrf-guard.ts. The guard has an always-on denylist for cloud metadata / link-local ranges (including 169.254.169.254) and a private-network denylist for RFC 1918 / loopback / CGNAT, both meant to hold even for a bundle that declares an internal base URL.
The guard's IPv6 classifiers only decode the dotted spelling of an IPv4-mapped IPv6 address (::ffff:169.254.169.254). Before the guard ever runs, the URL passes through new URL(), which normalizes an IPv4-mapped IPv6 host to its compressed-hex form: new URL('http://[::ffff:169.254.169.254]/').hostname is [::ffff:a9fe:a9fe]. isAlwaysForbiddenIPv6 and isPrivateIPv6 slice off the ::ffff: prefix and hand the remainder (a9fe:a9fe) to the IPv4 checks, whose dotted-quad regex rejects it, so both classifiers return false. The guard then reports the target as neither forbidden nor private and the executor performs the fetch, returning the response body to the caller.
This is a bypass of the recently hardened SSRF posture: the sibling guard safeFetch in mcp-from-openapi (fix for GHSA-65h7-9wrw-629c / GHSA-v6ph-xcq9-qxxj) decodes the IPv4-mapped-IPv6 hex form, but that fix is never reached on this execution path because the executor uses the platform fetch directly and relies solely on its own ssrf-guard.ts.
Affected component / versions
- Package:
@frontmcp/plugin-skilled-openapi(npm), published version1.8.0. The vulnerable dotted-only::ffff:handling ships in the release dist atindex.jslines 811-836. - Repository:
agentfront/frontmcp, default branchmain, commitcaf8b0c18997b7e5d457134ba85915f7c772c4e3. - Sink:
plugins/plugin-skilled-openapi/src/executor/openapi-runtime.ts. - Guard:
plugins/plugin-skilled-openapi/src/executor/ssrf-guard.ts. - This is distinct from GHSA-65h7-9wrw-629c and GHSA-v6ph-xcq9-qxxj (both cover
$refdereferencing during OpenAPI spec loading inmcp-from-openapi) and from GHSA-8q49-2h5h-434x (the OpenAPI adapter spec-change poller). It is a separate sink (per-operation execution), a separate component (plugin-skilled-openapiexecutor), and a separate root cause (the compressed-hex IPv4-mapped form is not decoded by the first-party guard).
Details
Root cause is CWE-918 (Server-Side Request Forgery) driven by CWE-20 / incomplete IP-literal parsing.
The two IPv6 classifiers only understand the dotted IPv4-mapped spelling:
isPrivateIPv6 (L98-L109) and isAlwaysForbiddenIPv6 (L112-L125) both do lower.startsWith('::ffff:') then pass lower.slice('::ffff:'.length) into isPrivateIPv4 / isAlwaysForbiddenIPv4. Those IPv4 helpers begin with isValidIPv4, which requires the dotted-quad regex /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/. When the payload is the compressed-hex a9fe:a9fe, the regex fails, isValidIPv4 returns false, and both classifiers return false.
The hostname the classifiers receive is already the compressed-hex form because checkOutboundUrl parses the target with new URL() and reads url.hostname. Confirmed on Node 26:
new URL('http://[::ffff:169.254.169.254]/latest/meta-data/').hostname === '[::ffff:a9fe:a9fe]'
new URL('https://[::ffff:10.0.0.5]/').hostname === '[::ffff:a00:5]'classifyHostLiteral strips the brackets, sees a colon, and classifies the host as an IPv6 literal, so control reaches the v6 branch:
With isAlwaysForbiddenIPv6('::ffff:a9fe:a9fe') false and isPrivateIPv6('::ffff:a9fe:a9fe') false, the branch returns { ok: true }.
The hostname allowlist provides no protection because it is auto-populated from the bundle's own base URL with the same new URL().hostname normalization:
So a bundle whose service.baseUrl is http://[::ffff:169.254.169.254]/ yields allowedHosts = {'[::ffff:a9fe:a9fe]'}, and the request URL built from that same base URL normalizes to the identical host, so the allowlist check in checkOutboundUrl passes:
The executor then fetches the URL and returns the response body to the caller:
The guard is invoked at L226 and the fetch is at L251. Redirects are correctly refused (redirect: 'manual', L264), so this is a single-hop read of the internal target. The decoded body is returned as data at L304. Connecting to an IPv4-mapped IPv6 literal such as [::ffff:169.254.169.254] reaches the IPv4 host 169.254.169.254 over a dual-stack socket, so the request lands on the real metadata / internal endpoint.
The adapter-level validateBaseUrl does not help: it only rejects non-http(s) schemes and does not inspect the host at all:
Taint source is the bundle-declared service.baseUrl, which is an unconstrained URL string in the bundle schema (baseUrl: z.string().url().max(2048), no IP or host restriction):
ssrf-guard.ts is the sole defense standing between that value and the outbound fetch on this path.
Impact
An actor who can get a bundle loaded with an attacker-chosen service.baseUrl can make the FrontMCP server issue requests to internal-only and cloud-metadata endpoints that the SSRF guard is specifically designed to block, and read the responses back through the normal operation result. The prime target is the cloud instance metadata service (http://169.254.169.254/latest/meta-data/iam/security-credentials/), disclosure of which yields the host's IAM credentials; internal-only HTTP(S) services (admin panels, databases behind HTTP, 10.0.0.0/8 and other RFC 1918 hosts) are equally reachable.
The plugin option defaults referenced below are defined in the plugin options schema:
Reachability by configuration, stated honestly:
- The scheme gate is independent of this bug. With the default
allowHttp: false, onlyhttps:targets pass, sohttp-only metadata endpoints (AWS/GCP/Azure IMDS) are not reachable unlessallowHttp: trueordev: trueis set. Internalhttps:services on private ranges are reachable under full defaults, because the private-network gate is what this bug bypasses. - With
allowHttp: trueordev: true,http://[::ffff:169.254.169.254]/latest/meta-data/reaches the metadata service, which is the always-forbidden range this bug defeats. - With
allowPrivateNetworks: true(self-hosted deployments that legitimately reach RFC 1918), the always-forbidden metadata block is the only remaining protection for169.254.169.254, and this bug bypasses exactly that block. - Authority to invoke the operation is not an additional barrier by default:
unprotectedOpsdefaults toallow, so a policy-less operation is callable on the execution surface (run_workflowor the internal per-op tools).
Precondition, stated honestly: the taint is control of the bundle's service.baseUrl. requireSignature defaults to true, so in a strict single-tenant deployment where only the operator authors and signs bundles there is no lower-privileged attacker, and the finding is not externally exploitable there. The realistic exposure is:
- Multi-tenant SaaS (the
saasbundle source) where tenants author bundles that the platform signs. A tenant setsservice.baseUrlto the IPv4-mapped-IPv6 form and reads the shared host's IMDS credentials or internal services. - Any deployment running
dev: trueorrequireSignature: false, which accepts unsigned bundles from any author. - Any deployment that loads a third-party bundle (npm / static source) that turns out to be malicious or compromised.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N, base score 8.5 (High). This matches the vector the maintainers assigned to the sibling bundle-controlled SSRF GHSA-65h7-9wrw-629c. Privileges-required is Low to reflect the authenticated bundle-author / tenant role; the score assumes a deployment (multi-tenant, dev / unsigned, or third-party bundle) where a party other than the operator can get a bundle loaded, as detailed above.
Proof of concept
Environment: Node v26.0.0. The guard file used below is a byte-identical copy of ssrf-guard.ts at commit caf8b0c18997b7e5d457134ba85915f7c772c4e3 (SHA-256 b41e6790ace8ec26db6d6e8fe83d2873bd90bc868f6b264bf593d3f515cd8c0b). allowedHosts is derived exactly as the runtime derives it (new URL(baseUrl).hostname.toLowerCase()). Full transcript in E2E_VERBATIM.txt.
Positive direction, guard verdicts (the hex forms pass):
allowedHosts (from baseUrl "http://[::ffff:169.254.169.254]/") = ["[::ffff:a9fe:a9fe]"]
checkOutboundUrl("http://[::ffff:169.254.169.254]/latest/meta-data/iam/security-credentials/", allowHttp:true) => {"ok":true}
allowedHosts (from baseUrl "https://[::ffff:10.0.0.5]/") = ["[::ffff:a00:5]"]
checkOutboundUrl("https://[::ffff:10.0.0.5]/admin/", DEFAULT config) => {"ok":true}Positive direction, real fetch against a loopback-only server, mirroring the sink fetch(req.url, {redirect:'manual'}):
local server bound 127.0.0.1:50362, secret=IMDS-SIMULATED-SECRET-1kdwlt866hsj
allowedHosts (from baseUrl) = ["[::ffff:7f00:1]"]
guard verdict for "http://[::ffff:127.0.0.1]:50362/latest/meta-data/" => {"ok":true}
fetch() status=200 body="IMDS-SIMULATED-SECRET-1kdwlt866hsj path=/latest/meta-data/"
SSRF-READ-CONFIRMED=trueNegative control (the forms the guard already handles are correctly blocked):
checkOutboundUrl("http://169.254.169.254/latest/meta-data/", allowHttp:true) => {"ok":false,"reason":"metadata/link-local IPv4 169.254.169.254 is always blocked"}
isAlwaysForbiddenIPv6("::ffff:169.254.169.254") = true
checkOutboundUrl("https://10.0.0.5/admin/", DEFAULT) => {"ok":false,"reason":"private/loopback IPv4 10.0.0.5 is blocked"}Fix verification against the actual patched guard file (see fix.patch):
[IMDS hex] http://[::ffff:169.254.169.254]/latest/meta-data/ => {"ok":false,"reason":"metadata/link-local IPv6 ::ffff:a9fe:a9fe is always blocked"}
[private hex (default cfg)] https://[::ffff:10.0.0.5]/admin/ => {"ok":false,"reason":"private IPv6 ::ffff:a00:5 is blocked"}
[loopback hex] http://[::ffff:127.0.0.1]:80/ => {"ok":false,"reason":"private IPv6 ::ffff:7f00:1 is blocked"}
[legit public host] https://api.stripe.com/v1/charges => {"ok":true}Remediation
Canonicalize an IPv4-mapped IPv6 address to its dotted-quad IPv4 form before the private / always-forbidden classification, so both the dotted (::ffff:169.254.169.254) and the compressed-hex (::ffff:a9fe:a9fe) spellings are decoded and checked. The included fix.patch adds a mappedIPv4ToDotted helper and routes both isPrivateIPv6 and isAlwaysForbiddenIPv6 through it; it applies cleanly to the affected commit and blocks the metadata, private, and loopback hex forms while still allowing legitimate public IPv6 hosts. A defense-in-depth improvement is to pin the resolved / connected address into the actual socket (custom undici dispatcher) so the classification and the connection cannot diverge, and to reject any IPv4-mapped IPv6 host outright unless a deployment explicitly needs it.
Credit
Reported by tonghuaroot.