Potential Container Escape via Modified release_agent File
Modification of the CGroup release_agent file from inside a privileged container can allow an attacker with SYS_ADMIN capabilities to escalate privileges and escape to the host machine.
CVE search metadata
CVE search record: CVE-2022-0492. Severity: high. CVSS: 7.8. EPSS: 5.24%. KEV: yes. Product: Docker Hub, KICS. Brief: Potential Container Escape via Modified release_agent File. Brief link: https://feed.craftedsignal.io/briefs/2024-01-release-agent-container-escape/
CVE search record: CVE-2019-5736. Severity: high. CVSS: 8.6. EPSS: 59.18%. KEV: no. Product: Docker Hub, KICS. Brief: Potential Container Escape via Modified release_agent File. Brief link: https://feed.craftedsignal.io/briefs/2024-01-release-agent-container-escape/
CVE search record: CVE-2024-21626. Severity: high. CVSS: 8.6. EPSS: 5.08%. KEV: no. Product: Docker Hub, KICS. Brief: Potential Container Escape via Modified release_agent File. Brief link: https://feed.craftedsignal.io/briefs/2024-01-release-agent-container-escape/
Triage facts
Revision 1- Applicability
- Docker Hub, KICS
- Evidence
- Confirmed activeHigh confidence
- Severity
- Medium
- Sources
- 4 public sources
- Freshness
- Revision 1Jan 3, 12:00 UTC
- Detection
- 2 rules
- Vulnerabilities
- 3 CVEs
What's new
- 1. exploited:true; KEV CVE-2022-0492 Nov 20, 03:10 via cisa-kev
- 2. poc_available; added CVE-2019-5736 +1; OS linux Jun 1, 10:01 via securelist
Overview
This threat involves the modification of the release_agent file within a CGroup directory from inside a privileged container. A privileged container, typically running on Linux, is granted elevated privileges, including SYS_ADMIN capabilities. An attacker leveraging a privileged container mounts a CGroup directory and alters the release_agent file, which is a script executed on the host at the termination of any process within that CGroup. This can lead to privilege escalation and a container escape, compromising the underlying host system. This is related to CVE-2022-0492, a vulnerability that can be exploited through this technique. The Elastic Defend for Containers integration introduced in version 9.3.0 helps detect such modifications.
Attack Chain
- Attacker gains access to a privileged container with
SYS_ADMINcapabilities. - The attacker mounts a CGroup directory within the container.
- The attacker modifies the
release_agentfile within the mounted CGroup directory, injecting malicious code. - A process within the container terminates, triggering the execution of the
release_agentscript on the host. - The host executes the attacker-controlled code contained in the modified
release_agentfile. - The attacker gains code execution on the host system.
- The attacker leverages the gained code execution to escalate privileges on the host.
- The attacker achieves a container escape and compromises the host.
Impact
Successful exploitation allows attackers to escape the container and gain arbitrary code execution on the host system. This can lead to a full compromise of the host, potentially affecting other containers and sensitive data residing on the machine. The impact can range from data exfiltration and denial of service to complete system takeover, depending on the permissions and access of the compromised host account.
Recommendation
- Deploy the "Potential release_agent Container Escape Detected via Defend for Containers" rule provided by Elastic Defend for Containers (version 9.3.0+) to detect malicious modifications of the
release_agentfile. - Monitor file changes on Linux hosts, specifically targeting the
release_agentfile, using the file integrity monitoring capabilities of your EDR or SIEM solution to surface unexpected modifications. - Reduce the attack surface by limiting the number of privileged containers and revoking unnecessary
SYS_ADMINcapabilities from containers to reduce the risk of exploitation. - Review system logs and audit logs on the host for any signs of unauthorized access or privilege escalation attempts that coincide with the alert timestamp related to this attack to prevent further escalation.
Detection coverage 2
Detect release_agent Modification in Containers
mediumDetects modifications to the release_agent file within a container environment, indicating a potential container escape attempt.
Detect Interactive Processes Modifying release_agent
highDetects modification of the `release_agent` file by an interactive process, suggesting manual intervention.
Detection queries are available on the platform. Get full rules →