CVE-2026-4802: Cockpit: cockpit: arbitrary command execution via crafted links in system logs ui

Published Mar 25, 2026
·
Updated

A flaw was found in Cockpit. This vulnerability allows a remote attacker to achieve arbitrary command execution on the host by exploiting unsanitized user-controlled parameters within crafted links in the system logs user interface (UI). An attacker can inject shell metacharacters and command substitutions into these parameters, leading to the execution of arbitrary shell commands on the affected system. This could result in a complete system compromise.

Other sources

vulnerability in Cockpit’s system logs UI code (pkg/systemd/logsJournal.jsx, loadServiceFilters() path). The flaw is caused by building a command from an array, joining it into a single string with only space escaping, and then executing it via /bin/bash -ec. User-controlled parameters from the logs page (e.g., #/system/logs#/?since=...) reach this code path unsanitized and can include shell metacharacters such as command substitution ($(...)). A crafted link can therefore inject arbitrary shell commands into the constructed pipeline (set -o pipefail; ... | grep ... | sort -u) and execute them on the host. The provided PoC demonstrates writing the output of id into /tmp/cockpit-rce-proof, confirming code execution in the target environment.

— Red Hat

Affected Software

2 affected componentsFixes available
Cockpit project Cockpit
debian/cockpit<=287.1-0+deb12u3, <=287.1-0+deb12u2
337-1+deb13u2370-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/cockpit to a version that resolves this vulnerability.

    Fixed in 337-1+deb13u2Fixed in 370-1

Event History

Mar 25, 2026
Data Sourced
via Red Hat·10:32 AM
DescriptionSeverityAffected Software
May 11, 2026
CVE Published
via MITRE·12:48 PM
Data Sourced
via MITRE·12:48 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·02:16 PM
DescriptionSeverityWeakness

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is the severity of CVE-2026-4802?

CVE-2026-4802 is classified as a critical vulnerability due to its potential for arbitrary command execution.

2

How do I fix CVE-2026-4802?

To fix CVE-2026-4802, upgrade to the latest version of Cockpit that addresses this vulnerability.

3

Who is affected by CVE-2026-4802?

CVE-2026-4802 affects all versions of Cockpit that do not implement proper sanitization for user-controlled parameters in system logs.

4

Can CVE-2026-4802 be exploited remotely?

Yes, CVE-2026-4802 can be exploited remotely by an attacker through crafted links in the system logs.

5

What type of attack is enabled by CVE-2026-4802?

CVE-2026-4802 enables arbitrary command execution, allowing potential attackers to execute unauthorized commands on the host system.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203