---
title: "CVE-2025-34281"
date: "2025-11-27T07:00:00+00:00"
url: "https://checkmarx.com/zero/vulnerabilities/cve-2025-34281/"
---

# CVE-2025-34281

[Disclosed vulnerabilities](https://checkmarx.com/zero/vulnerabilities/)

Fixed: Oct 15, 2025

CVE-2025-34281  **Published:** Nov 27, 2025

CWE-79 CWE-79 Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting')  6.2 Medium Severity IOT JAVA Stored-XSS XSS

JO João Oliveira  Reported by Checkmarx Zero

Details Overview

## Summary

ThingsBoard in versions prior to v4.2.1 allows an authenticated user to upload malicious SVG images via the “Image Gallery”, leading to a Stored Cross-Site Scripting (XSS) vulnerability. The exploit can be triggered when any user accesses the public API endpoint of the malicious SVG images, or if the malicious images are embedded in an `iframe` element, during a widget creation, deployed to any page of the platform (e.g., dashboards), and accessed during normal operations. The vulnerability resides in the `ImageController`, which fails to restrict the execution of JavaScript code when an image is loaded by the user’s browser. This vulnerability can lead to the execution of malicious code in the context of other users’ sessions, potentially compromising their accounts and allowing unauthorized actions.

## Product

This vulnerability affects ThingsBoard versions prior to v4.2.1.

## Impact

This vulnerability can lead to the execution of malicious code in the context of other users’ sessions, potentially compromising their accounts and allowing unauthorized actions.

## Steps to reproduce

1. Craft a simple payload to be injected into an SVG image that pops up a JavaScript alert:

    ```html
    <svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200">
     <!-- Visual SVG -->
     <rect width="200" height="200" fill="#3498db" />

     <!-- Text in the center -->
     <text x="50%" y="50%" font-size="20" text-anchor="middle" dy=".3em" fill="white">Proof of Concept</text>

     <!-- XSS Payload: Pop up an alert box with the JWT -->
     <script type="text/javascript">
         <![CDATA[
         alert(JSON.stringify(localStorage));
         ]]>
     </script>
    </svg>
    ```
2. Login to ThingsBoard as a tenant administrator
3. Upload the SVG image using the Image Gallery
4. Copy the public image API endpoint for the malicious SVG image
5. Access the public image API endpoint

### Expected result

The XSS payload is executed as soon as anyone accesses the malicious SVG image public API endpoint. It is also possible to embed the SVG image in an `iframe` by creating an widget, and deploying it to any page, like a dashboard. If a user during normal browsing opens the page with the malicious widget, the XSS payload will be executed.

## Remediation

Fixed in ThingsBoard v4.2.1 by adding the `Content-Security-Policy` header with the `default-src 'none'` value. This prevents external resources (scripts, styles, frames, etc.) being loaded from uploaded files, including SVG images.

## Credit

This issue was discovered and reported by Checkmarx Security Researcher [João Oliveira](https://www.linkedin.com/in/jo%C3%A3o-oliveira-638b5315b/).

## Resources

1. [NVD entry for CVE-2025-34281](https://nvd.nist.gov/vuln/detail/CVE-2025-34281)
2. [Fix Commit](https://github.com/thingsboard/thingsboard/commit/b2ae6f92d12206ea185a2e882945a6b69234bf03)

0  Medium Severity CVSS v4.0 Score

   6.2

CVSS v4.0 Vectors- Attack Vector: Network
- Attack Complexity: Low
- Attack Requirements: None
- Privileges Required: Low
- User Interaction: Passive
- Vulnerable System Confidentiality: None
- Vulnerable System Integrity: None
- Vulnerable System Availability: None
- Subsequent System Confidentiality: High
- Subsequent System Integrity: Low
- Subsequent System Availability: None

Advisory Timeline1. Discovered Mar 25, 2025
2. Disclosed Mar 31, 2025 The vulnerability was privately disclosed to the maintainers
3. Fixed Oct 15, 2025 Version 4.2.1 got released with the vulnerability fix.

## Explore more findings

[22 Apr 2026 CVE-2026-42236  Unauthenticated Denial of Service in n8n via MCP Client Registration   8.7  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2026-4223/) [22 Apr 2026 CVE-2026-42230  n8n has Open Redirect in MCP OAuth Consent Flow   5.1  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2026-42230/) [27 Feb 2026 CVE-2026-27578  n8n Vulnerable to Stored XSS via Various Nodes   8.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2026-27578/) [26 Feb 2026 CVE-2026-27950  Use-after-free in FreeRDP SDL2   5.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2026-27950/) [17 Jan 2025 CVE-2025-0825  HTTP Response Splitting in cpp-httplib   6.9  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2025-0825/) [17 Jun 2025 CVE-2025-6050  Stored Cross-Site Scripting (XSS) in Mezzanine CMS Admin Interface   4.8  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2025-6050/) [12 Dec 2024 CVE-2024-8374  Code Injection in UltiMaker Cura   7.8  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-8374/) [14 Nov 2024 CVE-2024-52526  Stored Cross-site Scripting in @LibreNMS/LibreNMS Services Tab   7.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-52526/) [14 Nov 2024 CVE-2024-51497  Stored Cross-site Scripting in @LibreNMS/LibreNMS Custom OID Tab   7.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-51497/) [14 Nov 2024 CVE-2024-51496  Reflected Cross-site Scripting in @LibreNMS/LibreNMS /wireless and /health endpoints   7.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-51496/) [  14 Nov 2024 CVE-2024-51495  Stored Cross-site Scripting in @LibreNMS/LibreNMS Device Overview `overwrite\_ip` Field   7.5  Visit the page ](https://checkmarx.com/zero/vulnerabilities/cve-2024-51495/) [14 Nov 2024 CVE-2024-51494  Stored Cross-site Scripting in @LibreNMS/LibreNMS Port Settings   7.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-51494/)
