3ngram 1.2.2
3ngram v1.2.2
Patch release: OAuth client resolution. A deployment whose DNS returns
IPv4-mapped answers could not authorize any Client ID Metadata Document (CIMD)
client at all, and the /oauth/authorize rejection that resulted was invisible
in logs. Both are fixed.
Changes
-
CIMD fetches no longer fail closed on IPv4-mapped DNS answers. The
SSRF guard's address-family agreement check compared the resolver-reported
family againstipaddr.process(), which unmaps::ffff:a.b.c.dto its
IPv4 form. A resolver reports that answer as family 6, so the unmapped kind
(ipv4→ 4) disagreed and a perfectly self-consistent answer was treated as
forged: every CIMD document fetch threwunsafe_addressbefore a socket was
opened, surfacing to the client as a bare400 invalid_client. The check now
usesipaddr.parse(), which preserves the wire form.The security boundary is unchanged.
isPublicClientMetadataAddress()
still classifies viaprocess(), so a mapped loopback, private, or otherwise
non-public answer (::ffff:127.0.0.1) is still rejected. Both directions are
pinned by tests. -
/oauth/authorizenow records why it rejected a request. One structured,
content-free line per rejected request (oauth: authorize endpoint) carrying
a hashedclient_id_prefixand a closed-setreason:not_registered,
metadata_*for each CIMD failure class,metadata_not_materialized,
unsupported_grant_type, orredirect_uri_mismatch. Previously all of these
returned an identical bare400 invalid_clientwith nothing written
anywhere, so a stale registration and a metadata document that never loaded
were indistinguishable in production logs.The response is unchanged — still a uniform
invalid_client, so there is no
enumeration oracle. The reason is diagnostic only and never leaves the log
line, and the rawclient_idis never written (CIMD identifiers are URLs
that may carry a query component — hard rule 6).
Upgrading
No configuration or migration changes. Operators running a CIMD client against
a resolver that returns IPv4-mapped addresses will see authorization start
working; everyone else sees only the new rejection log line.
Library versions
@3ngram/core 0.8.0 (new optional resolveOAuthClient failure seam;
two-argument callers are unaffected). @3ngram/db 0.7.0, @3ngram/schema
0.6.0, @3ngram/config 0.2.3 — unchanged.
Immutable container reference
ghcr.io/b3dmar/3ngram@sha256:7eef573b1ffc8f33b61dbd4884187060302f8e0f11c00175297ea906ec7670f3