LXD PKI Mode Vulnerability: Unauthorized Access Through Untrusted Certificates

Listen to this Post

2024-12-10

This article highlights a security issue within

Understanding the Vulnerability

LXD’s PKI mode mandates client and server certificates to be validated by a CA. However, an oversight in configuration enables unauthorized access if a non-CA signed certificate already resides in the trust store. This occurs due to a mismatch between settings:

PKI Mode Activation: The TLS listener configuration gets modified to include the CA certificate, enforcing stricter authentication.
Client Certificate Requirement: An inconsistency exists – the `ClientAuth` field remains set to `tls.RequestClientCert`. This merely requests a certificate from the client but doesn’t enforce its presence.

This enables scenarios where:

If a non-CA signed certificate is present beforehand, LXD client tools (Go client, `lxc`) won’t authenticate with it.
If a client sends a non-CA signed certificate during the handshake (and it’s in the trust store), it gets accepted despite lacking proper CA validation.

Impact and Recommendations

The impact of this vulnerability is considered low due to several factors:

PKI mode might not be widely used.

PKI mode setup likely involves an empty trust store initially.
Even with a non-CA signed certificate, trust verification still occurs.

However, it’s crucial to address this security gap. Here’s what you should do:

Update LXD: Upgrade LXD to a version that addresses the issue (version 5.21.2 or later).
Review Trust Store: Ensure the trust store only contains authorized certificates.
Avoid Untrusted Certificates: Refrain from placing untrusted certificates in the trust store.

What Undercode Says:

The table summarizes the vulnerability details for easy reference. Refer to the “References” section for further information and resources.

Additional Analysis

While the immediate risk might be low, this vulnerability highlights the importance of thorough security testing in infrastructure components like LXD. A seemingly minor configuration issue could have led to unauthorized access attempts. Here’s why this vulnerability deserves attention:

Potential Compromise: An attacker with a non-CA signed certificate in the trust store could gain access to sensitive container data or manipulate container configurations.
Exploitation Difficulty: Depending on the initial trust store setup, exploiting this vulnerability could be relatively simple.
Hidden Risk: Unintentional addition of untrusted certificates can occur due to human error or misconfigurations.

By proactively addressing this vulnerability and maintaining strict trust store management, you can significantly reduce the risk of unauthorized access to your LXD container environment.

References:

Reported By: Dailycve.com
https://www.twitter.com
Wikipedia: https://www.wikipedia.org
Undercode AI: https://ai.undercodetesting.com

Image Source:

OpenAI: https://craiyon.com
Undercode AI DI v2: https://ai.undercode.helpFeatured Image