Cross Site Scripting (XSS) in Assets in cockpit-hq/cockpit


Reported on

Mar 13th 2023


Cross-Site Scripting (XSS) attacks are a type of injection, in which malicious scripts are injected into otherwise benign and trusted websites. XSS attacks occur when an attacker uses a web application to send malicious code, generally in the form of a browser side script, to a different end user. Flaws that allow these attacks to succeed are quite widespread and occur anywhere a web application uses input from a user within the output it generates without validating or encoding it.

Proof of Concept

Step 1: Create a file named evil.html

<script type="text/javascript">alert(document.domain)</script>

Paste the code above inside the file of evil.html

Step 2: Login as admin

Step 3: Go to Assets

Step 4: Upload the created file

Step 5: Copy asset link and paste it at a new tab.

Step 6: XSS triggered


An attacker can use XSS to send a malicious script to an unsuspecting user. The end user’s browser has no way to know that the script should not be trusted, and will execute the script. Because it thinks the script came from a trusted source, the malicious script can access any cookies, session tokens, or other sensitive information retained by the browser and used with that site. These scripts can even rewrite the content of the HTML page.


We are processing your report and will contact the cockpit-hq/cockpit team within 24 hours. 6 months ago
We have contacted a member of the cockpit-hq/cockpit team and are waiting to hear back 6 months ago
6 months ago


Any update for this?

6 months ago


Any update?

5 months ago


Update from maintainer?

Artur validated this vulnerability a month ago
choocs has been awarded the disclosure bounty
The fix bounty is now up for grabs
The researcher's credibility has increased: +7
Artur marked this as fixed in 2.6.3 with commit b8dad5 a month ago
The fix bounty has been dropped
This vulnerability has been assigned a CVE
Artur published this vulnerability a month ago
bootstrap.php#L54-L239 has been validated
to join this conversation