Impact
The Keylime registrar does not enforce mutual TLS (mTLS) client certificate authentication since version 7.12.0. The registrar's TLS context is configured with ssl.CERTOPTIONAL instead of ssl.CERTREQUIRED, allowing any client to connect to protected API endpoints without presenting a valid client certificate.
Who is impacted: - All Keylime deployments running versions 7.12.0 through 7.13.0 - Environments where the registrar HTTPS port (default 8891) is network-accessible to untrusted clients
What an attacker can do: - List all registered agents (GET /v2/agents/) - enumerate the entire agent inventory - Retrieve agent details (GET /v2/agents/{uuid}) - obtain public TPM keys, certificates, and network locations (IP/port) of any agent - Delete any agent (DELETE /v2/agents/{uuid}) - remove agents from the registry, disrupting attestation services
Note: The exposed TPM data (EK, AK, certificates) consists of public keys and certificates. Private keys remain protected within TPM hardware. The HMAC secret used for challenge-response validation is stored in the database but is not exposed via the API.
Affected versions: >= 7.12.0, <= 7.13.0
Fixed versions: 7.12.2, >= 7.13.1
Patches
A patch for the affected released versions is available. It removes the line that override the configuration of ssl.verifymode, leaving the CERTREQUIRED value set by webutil.initmtls():
diff diff --git a/keylime/web/base/server.py b/keylime/web/base/server.py index 1d9a9c2..859b23a 100644 --- a/keylime/web/base/server.py +++ b/keylime/web/base/server.py @@ -2,7 +2,6 @@ import asyncio import multiprocessing from abc import ABC, abstractmethod from functools import wraps -from ssl import CERTOPTIONAL from typing import TYPECHECKING, Any, Callable, Optional
import tornado @@ -252,7 +251,6 @@ class Server(ABC): self.httpsport = config.getint(component, "tlsport", fallback=0) self.maxuploadsize = config.getint(component, "maxuploadsize", fallback=104857600) self.sslctx = webutil.initmtls(component) - self.sslctx.verifymode = CERTOPTIONAL
def get(self, pattern: str, controller: type["Controller"], action: str, allowinsecure: bool = False) -> None: """Creates a new route to handle incoming GET requests issued for paths which match the given
Users should upgrade to the patched version once it is released.
Workarounds
If upgrading is not immediately possible, apply one of the following mitigations:
1. Network isolation (Recommended)
Restrict access to the registrar HTTPS port (default 8891) using firewall rules to allow only trusted hosts (verifier, tenant):
Example using iptables iptables -A INPUT -p tcp --dport 8891 -s <verifierip> -j ACCEPT iptables -A INPUT -p tcp --dport 8891 -s <tenantip> -j ACCEPT iptables -A INPUT -p tcp --dport 8891 -j DROP
2. Reverse proxy with mTLS enforcement
Deploy a reverse proxy (nginx, HAProxy) in front of the registrar that enforces client certificate authentication:
Example nginx configuration server { listen 8891 ssl; sslcertificate /path/to/server.crt; sslcertificatekey /path/to/server.key; sslclientcertificate /path/to/ca.crt; sslverifyclient on; # Enforce client certificates
location / { proxypass https://localhost:8892; # Internal registrar port } }
Description: Due to chunked decoder lenience Squid is vulnerable to Request/Response smuggling attacks when parsing HTTP/1.1 and ICAP messages
Reference: https://github.com/squid-cache/squid/security/advisories/GHSA-j83v-w3p4-5cqh
Affected versions: 2.6-6.3. Patched in 6.4.
A remote stack overflow in the TIPC networking module. With FORTIFYSOURCE's stricter memcpy() bounds checking, this can be exploited to cause remote DOS via kernel panic on systems using TIPC. Prior to these bounds checks, and with a canary leak (or no CONFIGSTACKPROTECTOR), this can be exploited for RCE.
Reference: https://www.openwall.com/lists/oss-security/2022/02/10/1
A crafted request uri-path can cause modproxy to forward the request to an origin server choosen by the remote user. This issue affects Apache HTTP Server 2.4.48 and earlier.
A heap overflow vulnerability was found in openslp, that may result in remote code execution.
apachemodphp. Multiple issues were addressed by updating to PHP version 7.3.11.
An unspecified flaw was found in the Libraries component in OpenJDK. ObjectInputStream's readSerialData() could, in certain cases, incorrectly perform deserialization of data from serialized input. An untrusted Java application or applet could use this flaw to bypass Java sandbox restrictions.
GNU Bash through 4.3 bash43-025 processes trailing strings after certain malformed function definitions in the values of environment variables, which allows remote attackers to write to files or possibly have unknown other impact via a crafted environment, as demonstrated by vectors involving the ForceCommand feature in OpenSSH sshd, the modcgi and modcgid modules in the Apache HTTP Server, scripts executed by unspecified DHCP clients, and other situations in which setting the environment occurs across a privilege boundary from Bash execution. NOTE: this vulnerability exists because of an incomplete fix for CVE-2014-6271.
A flaw was found in the bash functionality that evaluates specially formatted environment variables passed to it from another environment. An attacker could use this feature to override or bypass restrictions to the environment to execute shell commands before restrictions have been applied. Certain services and applications allow remote unauthenticated attackers to provide environment variables, allowing them to exploit this issue.
Acknowledgements:
Red Hat would like to thank Stephane Chazelas for reporting this issue.