Skip to content
Threat Feed
medium threat exploited PoC updated

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

  1. Attacker gains access to a privileged container with SYS_ADMIN capabilities.
  2. The attacker mounts a CGroup directory within the container.
  3. The attacker modifies the release_agent file within the mounted CGroup directory, injecting malicious code.
  4. A process within the container terminates, triggering the execution of the release_agent script on the host.
  5. The host executes the attacker-controlled code contained in the modified release_agent file.
  6. The attacker gains code execution on the host system.
  7. The attacker leverages the gained code execution to escalate privileges on the host.
  8. 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_agent file.
  • Monitor file changes on Linux hosts, specifically targeting the release_agent file, 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_ADMIN capabilities 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

medium

Detects modifications to the release_agent file within a container environment, indicating a potential container escape attempt.

sigma tactics: privilege_escalation techniques: T1611 sources: file_event, linux

Detect Interactive Processes Modifying release_agent

high

Detects modification of the `release_agent` file by an interactive process, suggesting manual intervention.

sigma tactics: privilege_escalation techniques: T1611 sources: file_event, linux

Detection queries are available on the platform. Get full rules →