CVE-2026-4631
Command Injection in Cockpit Remote Login Enables Unauthenticated RCE
Publication date: 2026-04-07
Last updated on: 2026-04-10
Assigner: Red Hat, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| cockpit_project | cockpit | * |
| cockpit | cockpit | From 327|end_excluding=9.6 (inc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-78 | The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
CVE-2026-4631 is a critical vulnerability in Cockpit, a web-based server management tool for Linux. The issue arises because Cockpit's remote login feature passes user-supplied hostnames and usernames directly to the SSH client without any validation or sanitization.
An attacker with network access to the Cockpit web service can send a specially crafted HTTP request to the login endpoint that injects malicious SSH options or shell commands. This injection happens before any credential verification, meaning the attacker does not need valid login credentials to exploit it.
The vulnerability allows remote code execution on the Cockpit host by exploiting how SSH command-line arguments are constructed and executed. Specifically, the username and hostname parameters are passed as command-line arguments to the SSH client without checks, enabling injection of commands or SSH options.
How can this vulnerability impact me? :
This vulnerability can have severe impacts because it allows unauthenticated remote code execution on the Cockpit host. An attacker can execute arbitrary commands on the server running Cockpit without needing any valid credentials.
- Complete compromise of the Cockpit host system.
- Potential unauthorized access to sensitive data or system resources.
- Disruption of server management operations.
- Possibility for attackers to establish persistent access or pivot to other systems.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
Detection of this vulnerability involves monitoring for unusual or crafted HTTP requests to the Cockpit web service, specifically targeting the login endpoint with suspicious username or hostname parameters that may contain shell metacharacters or SSH options.
Since the exploit is triggered by a single HTTP request to the endpoint `/cockpit+=<hostname>/login` with an Authorization header, network detection can focus on identifying such requests with unusual or malformed parameters.
On the system, checking the version of Cockpit and OpenSSH can help determine vulnerability status: Cockpit versions >= 326/327 combined with OpenSSH versions older than 9.6 are vulnerable.
- Use network monitoring tools (e.g., tcpdump, Wireshark) to capture HTTP requests to the Cockpit service and filter for requests to the login endpoint containing suspicious characters.
- Check Cockpit version: `rpm -q cockpit` or equivalent package manager commands.
- Check OpenSSH version: `ssh -V` to ensure it is version 9.6 or newer.
- Review system logs for unexpected SSH command executions or unusual file creations (e.g., presence of files like `/tmp/flag` as in the example exploit).
What immediate steps should I take to mitigate this vulnerability?
Immediate mitigation steps include updating affected components and applying configuration changes to prevent exploitation.
- Upgrade OpenSSH to version 9.6 or later, which includes early hostname validation rejecting hostnames and usernames with shell metacharacters.
- Upgrade Cockpit to version 327 or later, where fixes such as inserting a `--` separator before the hostname argument and input validation are implemented.
- If immediate upgrades are not possible, restrict network access to the Cockpit web service to trusted users only, minimizing exposure.
- Implement firewall rules or network segmentation to block unauthorized access to the Cockpit login endpoint.
- Monitor logs and network traffic for suspicious activity targeting the Cockpit login endpoint.
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
The provided information does not specify how CVE-2026-4631 affects compliance with common standards and regulations such as GDPR or HIPAA.