Summary
RabbitMQ can disable TLS certificate verification when no CA bundle is available, allowing an attacker positioned between the broker and the identity provider to forge JWKS responses.
In affected OAuth2 deployments, this may cause the broker to accept attacker-controlled JWTs and grant unauthorized access.
RabbitMQ can disable TLS certificate verification when no CA bundle is available, allowing an attacker positioned between the broker and the identity provider to forge JWKS responses.
In affected OAuth2 deployments, this may cause the broker to accept attacker-controlled JWTs and grant unauthorized access.
Affected context
The issue occurs in RabbitMQ deployments that use the OAuth2 plugin without an explicitly configured CA certificate bundle. If the operating-system CA bundle is empty or unreadable, such as in some minimal container images, the TLS client may fall back to verify_none without warning when retrieving JWKS data.
The issue occurs in RabbitMQ deployments that use the OAuth2 plugin without an explicitly configured CA certificate bundle. If the operating-system CA bundle is empty or unreadable, such as in some minimal container images, the TLS client may fall back to verify_none without warning when retrieving JWKS data.
Exploit preconditions
- Attack surface: TLS communication between RabbitMQ and the JWKS or OAuth2 identity provider
- Required access: A network man-in-the-middle position capable of intercepting and modifying the JWKS response
- Trigger point: JWKS retrieval and JWT validation by the OAuth2 plugin
- Configuration condition: No
cacertfileis configured and the operating-system CA bundle is unavailable or unreadable - Why exploitation is possible: Certificate verification is disabled instead of failing closed, allowing forged JWKS data to be trusted
- Attack surface: TLS communication between RabbitMQ and the JWKS or OAuth2 identity provider
- Required access: A network man-in-the-middle position capable of intercepting and modifying the JWKS response
- Trigger point: JWKS retrieval and JWT validation by the OAuth2 plugin
- Configuration condition: No
cacertfileis configured and the operating-system CA bundle is unavailable or unreadable - Why exploitation is possible: Certificate verification is disabled instead of failing closed, allowing forged JWKS data to be trusted
Why this happens
The underlying defect is an unsafe fallback in TLS certificate verification. When no trusted CA bundle is available, ssl_options/1 selects verify_none without producing a warning, causing the broker to accept TLS connections without authenticating the remote certificate.
This maps to CWE-295: Improper Certificate Validation, because the security-sensitive connection does not properly validate the peer certificate before trusting identity metadata used for JWT verification.
The underlying defect is an unsafe fallback in TLS certificate verification. When no trusted CA bundle is available, ssl_options/1 selects verify_none without producing a warning, causing the broker to accept TLS connections without authenticating the remote certificate.
This maps to CWE-295: Improper Certificate Validation, because the security-sensitive connection does not properly validate the peer certificate before trusting identity metadata used for JWT verification.
Potential impact
- An attacker could forge JWKS responses
- The broker may accept arbitrary attacker-controlled JWTs
- Unauthorized users could gain access to protected messaging or streaming resources
- Authentication and authorization boundaries could be bypassed
- Compromised identities could be used for data access, publication, or administrative actions
- An attacker could forge JWKS responses
- The broker may accept arbitrary attacker-controlled JWTs
- Unauthorized users could gain access to protected messaging or streaming resources
- Authentication and authorization boundaries could be bypassed
- Compromised identities could be used for data access, publication, or administrative actions
General mitigation guidance
Mitigation generally focuses on ensuring TLS connections fail closed when certificate trust cannot be established.
Common defensive patterns include:
- Configure an explicit, readable CA bundle for OAuth2 identity-provider connections
- Require peer certificate verification rather than permitting
verify_none - Treat missing, empty, or unreadable trust stores as startup or connection errors
- Validate the expected identity-provider endpoint and protect JWKS retrieval paths
- Run brokers with only the permissions and network access required for their role
- Use container images and runtime policies that provide and preserve trusted CA material
Mitigation generally focuses on ensuring TLS connections fail closed when certificate trust cannot be established.
Common defensive patterns include:
- Configure an explicit, readable CA bundle for OAuth2 identity-provider connections
- Require peer certificate verification rather than permitting
verify_none - Treat missing, empty, or unreadable trust stores as startup or connection errors
- Validate the expected identity-provider endpoint and protect JWKS retrieval paths
- Run brokers with only the permissions and network access required for their role
- Use container images and runtime policies that provide and preserve trusted CA material
How teams detect issues like this
Organizations can look for this weakness through:
- Static analysis and configuration checks for
verify_noneor disabled certificate verification - Code review signals involving fallback TLS options when CA files are absent
- Deployment-policy checks ensuring OAuth2 services define readable CA bundles
- Runtime monitoring for warnings, failed trust-store loads, or unexpected identity-provider certificates
- Network security monitoring for altered JWKS responses or TLS interception
Automated configuration and code review tools can help enforce fail-closed TLS policies.
Organizations can look for this weakness through:
- Static analysis and configuration checks for
verify_noneor disabled certificate verification - Code review signals involving fallback TLS options when CA files are absent
- Deployment-policy checks ensuring OAuth2 services define readable CA bundles
- Runtime monitoring for warnings, failed trust-store loads, or unexpected identity-provider certificates
- Network security monitoring for altered JWKS responses or TLS interception
Automated configuration and code review tools can help enforce fail-closed TLS policies.

