GHSA-RGM6-H343-49V3
Hex-normalized ::/96 addresses bypass SSRF filter due to ipaddr.js range omission
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-RGM6-H343-49V3 divulgada · CVSS 3.7 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
When WHATWG URL parsers normalize IPv4-compatible IPv6 addresses like http://[::127.0.0.1]/ or http://[::169.254.169.254]/ into hex (::7f00:1 and ::a9fe:a9fe), ipaddr.js classifies their range as 'unicast'. Because request-filtering-agent permits connections when .range() === 'unicast', these addresses bypass the agent filter and reach socket connect.
Details
### Root Cause
`request-filtering-agent` inspects resolved IPs and checks whether `ipaddr.parse(addr).range() === 'unicast'`.
In WHATWG URL parsing (Node.js `new URL()`), dotted addresses like `::127.0.0.1` and `::169.254.169.254` are normalized to hex strings `::7f00:1` and `::a9fe:a9fe`. In `ipaddr.js`, `IPv6.prototype.SpecialRanges` omits the RFC 4291 `::/96` range, returning `'unicast'` for hex forms.
Consequently, `request-filtering-agent` permits these connections straight through to `net.Socket.connect()`.
### Recommended Fix
Downstream mitigation: In `request-filtering-agent.ts`, check if the address matches `::/96`:
const isIPv4Compatible = parsedAddr.match(ipaddr.parseCIDR("::/96"));
if (isIPv4Compatible && !allowPrivate) {
// block connection
}We have also notified upstream `ipaddr.js` maintainers.
Proof of concept
- Start request-filtering-agent with default options.
- Request http://[::1]:8080/ -> Blocked (CONTROL PASS).
- Request http://[::127.0.0.1]/ or connect to [::7f00:1] -> ipaddr.parse('::7f00:1').range() returns 'unicast' -> Filter passes, reaching socket.connect().
Impact
SSRF bypass in environments where IPv4-compatible translation routing is enabled or where callers expect all RFC 4291 special-use addresses to be blocked.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npmrequest-filtering-agent |
Sin parche | — | — | 3.2.1 afectada |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/azu/request-filtering-agent/security/advisories/GHSA-rgm6-h343-49v3Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
