NATS has mTLS verify_and_map authentication bypass via incorrect Subject DN matching
nats-io nats-server
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| github.com/nats-io/nats-server/v2 Go |
|
|
| github.com/nats-io/nats-server Go |
| No fix yet |
nats-io nats-server
| Product | Affected | Fixed in |
|---|---|---|
| github.com/nats-io/nats-server/v2 Go |
|
|
| github.com/nats-io/nats-server Go |
| No fix yet |
NATS-Server is a High-Performance server for NATS.io, a cloud and edge native messaging system. Prior to versions 2.11.15 and 2.12.6, when using mTLS for client identity, with `verify_and_map` to derive a NATS identity from the client certificate's Subject DN, certain patterns of RDN would not be correctly enforced, allowing for authentication bypass. This does require a valid certificate from a CA already trusted for client certificates, and `DN` naming patterns which the NATS maintainers consider highly unlikely. So this is an unlikely attack. Nonetheless, administrators who have been very sophisticated in their `DN` construction patterns might conceivably be impacted. Versions 2.11.15 and 2.12.6 contain a fix. As a workaround, developers should review their CA issuing practices.
From the CVE record · GitHub_M
NATS-Server can incorrectly enforce certain Subject DN patterns when `verify_and_map` derives a client identity from an mTLS certificate. A connecting client with a valid certificate from an already-trusted CA could bypass authentication if the server uses the affected, highly unusual DN patterns. No user interaction is required.
Administrators using `github.com/nats-io/nats-server/v2` before 2.11.15 or from 2.12.0-RC.1 before 2.12.6, and users of any version of `github.com/nats-io/nats-server`, should check their deployments.