Summary
RabbitMQ's trust-store plugin can incorrectly accept a forged self-signed client certificate when its issuer name and serial number match those of a whitelisted certificate. This can let an attacker bypass TLS client authentication and access broker services when the plugin is enabled as the TLS verification callback.
RabbitMQ's trust-store plugin can incorrectly accept a forged self-signed client certificate when its issuer name and serial number match those of a whitelisted certificate. This can let an attacker bypass TLS client authentication and access broker services when the plugin is enabled as the TLS verification callback.
Affected context
The vulnerability occurs in RabbitMQ deployments that enable the trust-store plugin and configure it as the TLS verify_fun. The plugin identifies certificates using only the issuer distinguished name and serial number from the presented certificate, without confirming the certificate's public key, subject key identifier, fingerprint, signature, or trust-chain validity. The issue is relevant when an attacker can determine the identifying values of a whitelisted certificate.
The vulnerability occurs in RabbitMQ deployments that enable the trust-store plugin and configure it as the TLS verify_fun. The plugin identifies certificates using only the issuer distinguished name and serial number from the presented certificate, without confirming the certificate's public key, subject key identifier, fingerprint, signature, or trust-chain validity. The issue is relevant when an attacker can determine the identifying values of a whitelisted certificate.
Exploit preconditions
- Attack surface: TLS client-authenticated RabbitMQ listeners using the trust-store plugin
- Required access: Network connectivity to a TLS endpoint and knowledge of, or ability to guess, the issuer name and serial number associated with a whitelisted certificate
- Trigger point: Client certificate verification during the TLS handshake
- Why exploitation is possible: The verification callback can override
unknown_caorselfsigned_peererrors after a metadata-only whitelist lookup, while the stored certificate is not compared with the presented certificate and is not used as a trust anchor
- Attack surface: TLS client-authenticated RabbitMQ listeners using the trust-store plugin
- Required access: Network connectivity to a TLS endpoint and knowledge of, or ability to guess, the issuer name and serial number associated with a whitelisted certificate
- Trigger point: Client certificate verification during the TLS handshake
- Why exploitation is possible: The verification callback can override
unknown_caorselfsigned_peererrors after a metadata-only whitelist lookup, while the stored certificate is not compared with the presented certificate and is not used as a trust anchor
Why this happens
The underlying bug is improper certificate validation, mapped to CWE-295. The plugin treats the issuer distinguished name and serial number as sufficient identity for a whitelisted certificate. Because these values are copied from the presented certificate and are not cryptographically bound to the original certificate's public key or signature, a forged certificate can satisfy the lookup and cause certificate verification failures to be overridden. This is an insecure trust decision based on mutable, non-authenticating certificate metadata.
The underlying bug is improper certificate validation, mapped to CWE-295. The plugin treats the issuer distinguished name and serial number as sufficient identity for a whitelisted certificate. Because these values are copied from the presented certificate and are not cryptographically bound to the original certificate's public key or signature, a forged certificate can satisfy the lookup and cause certificate verification failures to be overridden. This is an insecure trust decision based on mutable, non-authenticating certificate metadata.
Potential impact
- An attacker could bypass TLS client authentication.
- An attacker could gain unauthorized access to RabbitMQ protocols or management interfaces exposed through the affected listener.
- An attacker could publish, consume, alter, or delete messages according to the permissions assigned after authentication.
- An attacker could use broker access to disrupt messaging workflows or affect connected applications.
- An attacker could bypass TLS client authentication.
- An attacker could gain unauthorized access to RabbitMQ protocols or management interfaces exposed through the affected listener.
- An attacker could publish, consume, alter, or delete messages according to the permissions assigned after authentication.
- An attacker could use broker access to disrupt messaging workflows or affect connected applications.
General mitigation guidance
Mitigation generally focuses on ensuring that client certificate acceptance remains cryptographically anchored and independent of attacker-controlled certificate metadata.
Common defensive patterns include:
- Use standard certificate-chain validation against a controlled CA trust store.
- Compare presented certificates using cryptographically strong identities such as validated fingerprints or public keys when explicit allowlisting is required.
- Do not override
unknown_ca,selfsigned_peer, or related verification failures solely because issuer and serial fields match an allowlist entry. - Keep trust-store contents protected from unauthorized modification and disclosure where practical.
- Apply least-privilege permissions to authenticated broker identities and restrict TLS listeners to required networks.
- Disable the trust-store verification path when it is not required, or use a secure verification mechanism provided by the deployment's TLS architecture.
Mitigation generally focuses on ensuring that client certificate acceptance remains cryptographically anchored and independent of attacker-controlled certificate metadata.
Common defensive patterns include:
- Use standard certificate-chain validation against a controlled CA trust store.
- Compare presented certificates using cryptographically strong identities such as validated fingerprints or public keys when explicit allowlisting is required.
- Do not override
unknown_ca,selfsigned_peer, or related verification failures solely because issuer and serial fields match an allowlist entry. - Keep trust-store contents protected from unauthorized modification and disclosure where practical.
- Apply least-privilege permissions to authenticated broker identities and restrict TLS listeners to required networks.
- Disable the trust-store verification path when it is not required, or use a secure verification mechanism provided by the deployment's TLS architecture.
How teams detect issues like this
Organizations can look for:
- Configuration reviews identifying RabbitMQ listeners that use the trust-store plugin as a TLS verification callback.
- Static analysis or code review findings for certificate acceptance based only on issuer names, serial numbers, or other non-cryptographic metadata.
- Tests that submit certificates with matching issuer and serial fields but different public keys, signatures, or trust chains.
- TLS and broker audit logs showing successful client authentication from unexpected certificates or identities.
- Policy checks requiring certificate validation to terminate at an approved CA or cryptographically verified certificate identity.
- Automated security review tools that flag verification callbacks which suppress certificate errors without full-chain validation.
Organizations can look for:
- Configuration reviews identifying RabbitMQ listeners that use the trust-store plugin as a TLS verification callback.
- Static analysis or code review findings for certificate acceptance based only on issuer names, serial numbers, or other non-cryptographic metadata.
- Tests that submit certificates with matching issuer and serial fields but different public keys, signatures, or trust chains.
- TLS and broker audit logs showing successful client authentication from unexpected certificates or identities.
- Policy checks requiring certificate validation to terminate at an approved CA or cryptographically verified certificate identity.
- Automated security review tools that flag verification callbacks which suppress certificate errors without full-chain validation.

