Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-2947 Overview
CVE-2024-2947 is a command injection vulnerability in Cockpit, the web-based graphical interface for Linux servers. The flaw resides in the sosreport handling logic exposed through the Cockpit web interface. An authenticated local user can craft a sosreport filename containing shell metacharacters and trigger command injection when the report is deleted. Successful exploitation leads to privilege escalation on the affected host. The vulnerability is tracked under CWE-77: Improper Neutralization of Special Elements used in a Command and affects Cockpit versions 270 and newer.
Critical Impact
An authenticated local attacker who can submit a crafted sosreport name through the Cockpit interface can execute arbitrary commands and escalate privileges on the underlying system.
Affected Products
- Cockpit versions 270 and newer
- Red Hat Enterprise Linux distributions shipping affected Cockpit packages (see Red Hat CVE Analysis CVE-2024-2947)
- Fedora distributions shipping affected Cockpit packages (see Fedora package announcements referenced below)
Discovery Timeline
- 2024-03-28 - CVE-2024-2947 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-2947
Vulnerability Analysis
Cockpit integrates with sosreport, a diagnostic data collection tool used across Red Hat and Fedora systems. Administrators can generate, download, and delete sosreports through the Cockpit web console. The deletion workflow accepts a report name that is later incorporated into a shell command executed with elevated privileges. Because the report name is not properly sanitized before being passed to the underlying shell, attacker-supplied metacharacters are interpreted as command separators. The condition requires an authenticated local user with Cockpit access and user interaction to initiate the delete action.
Root Cause
The root cause is improper neutralization of special elements used in a command, classified as [CWE-77]. The sosreport deletion routine constructs a command string using the user-controlled filename without escaping or using safe argument arrays. Any shell metacharacter such as ;, |, &&, or backticks embedded in the crafted name is parsed by the shell at execution time.
Attack Vector
Exploitation requires local access and valid Cockpit credentials. The attacker creates a sosreport whose filename embeds a shell payload, then invokes the delete action through the Cockpit web interface. The injected commands execute in the security context of the sosreport handler, which runs with elevated privileges, resulting in privilege escalation. See the Red Hat Bugzilla Report #2271614 for additional technical context. No public proof-of-concept code is referenced in the enriched data; the vulnerability is described in prose rather than demonstrated with synthetic code.
Detection Methods for CVE-2024-2947
Indicators of Compromise
- Unusual sosreport filenames containing shell metacharacters such as ;, |, `, $(), or && in /var/tmp/ or sosreport output directories.
- Unexpected child processes spawned by the Cockpit cockpit-bridge or sosreport helper processes.
- Audit log entries showing privileged command execution immediately following a sosreport delete action in Cockpit.
Detection Strategies
- Enable Linux auditd rules to log execve calls originating from Cockpit service accounts and sosreport helper binaries.
- Correlate Cockpit web access logs with system command execution to flag delete operations followed by shell invocations.
- Review /var/log/cockpit/ and journal entries for sosreport operations tied to anomalous filenames.
Monitoring Recommendations
- Alert on process lineage where sosreport cleanup paths execute shells (sh, bash) or utilities not required for report deletion.
- Monitor local account activity on Cockpit-enabled hosts for privilege escalation sequences following web console authentication.
- Track installed Cockpit package versions across the fleet to identify hosts running vulnerable builds (270 and newer prior to patch).
How to Mitigate CVE-2024-2947
Immediate Actions Required
- Apply the vendor-provided Cockpit updates referenced in RHSA-2024:3667 and RHSA-2024:3843 on affected Red Hat systems.
- Update Fedora Cockpit packages via the advisories distributed through the Fedora Package Announcement Archive.
- Restrict Cockpit console access to trusted administrators and enforce strong authentication.
Patch Information
Red Hat has published patched Cockpit packages through RHSA-2024:3667 and RHSA-2024:3843. Fedora has issued corresponding updates referenced in the Fedora announcement and follow-up announcement. Administrators should upgrade Cockpit to the patched version appropriate for their distribution.
Workarounds
- Disable the Cockpit sosreport plugin on hosts where the diagnostic workflow is not required until patches are applied.
- Limit Cockpit login privileges to a narrow set of administrators and audit sudo access granted through Cockpit.
- Stop and disable the cockpit.socket service on systems that do not actively require web-based administration.
# Configuration example: disable Cockpit until patched
sudo systemctl stop cockpit.socket
sudo systemctl disable cockpit.socket
# Verify installed Cockpit version
rpm -q cockpit
# Apply vendor updates (RHEL/Fedora)
sudo dnf update cockpit cockpit-bridge cockpit-ws
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

