ThingsBoard IoT Platform SSRF via SVG Image Upload (CVE-2025-34282)
by Tamil Mathi T. (mathitam) · 2026-07-06
- Severity
- Critical
- CVE
- CVE-2025-34282
- Category
- web
- Affected product
- ThingsBoard IoT Platform (Image Upload Gallery / Widget Library)
- Affected versions
- < 4.2.1 (tested on 4.2.0; fixed in 4.2.1)
- Disclosed
- 2026-07-06
- Patch status
- patched
References
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-06 |
| Last Updated | 2026-07-06 |
| Author / Researcher | Tamil Mathi T. (mathitam) |
| CVE / Advisory | CVE-2025-34282 |
| Category | web |
| Severity | Critical |
| CVSS Score | 9.1 (per NVD); 6.9 Medium per the original disclosure README |
| Status | Weaponized |
| Tags | thingsboard, ssrf, cwe-918, svg, image-upload, iot, python, widget-library, tenant-admin |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | ThingsBoard IoT Platform (Image Upload Gallery / Widget Library) |
| Versions Affected | < 4.2.1 (tested on 4.2.0; fixed in 4.2.1) |
| Language / Platform | Python 3 (exploit script), SVG/XML (payload); targets a Java-based ThingsBoard server |
| Authentication Required | Yes (Tenant Admin bearer token) |
| Network Access Required | Yes |
Summary
ThingsBoard versions before 4.2.1 are vulnerable to Server-Side Request Forgery (CWE-918) through its Image Upload Gallery feature. A Tenant Admin can upload a crafted SVG file whose <image xlink:href="..."> (or <pattern>/<image>) element references an arbitrary internal or attacker-controlled URL. When the server later processes/renders that SVG — either at upload time or when the resulting public link is embedded in a custom dashboard widget via an <object> tag — ThingsBoard’s backend issues an outbound HTTP request to the attacker-supplied URL. This allows a Tenant Admin (a role below System Admin) to make the server reach internal-only services (e.g. metadata endpoints, internal admin panels, other tenants’ infrastructure) that are not otherwise exposed to the network. The included Python PoC automates the full attack chain: uploading the malicious SVG, extracting its publicLink, and creating a custom widget that embeds that link so the SSRF fires whenever the widget is rendered.
Vulnerability Details
Root Cause
ThingsBoard’s Image Upload Gallery (POST /api/image) accepts SVG files and processes them server-side without stripping or sandboxing external resource references. SVG natively supports referencing external resources via elements such as <image xlink:href="...">. The payload used in this PoC (ssrf_localhost_5555.svg) embeds:
| |
When the SVG is processed by the server (during upload processing and/or subsequent rendering), the backend resolves and fetches this xlink:href target itself, rather than only having it resolved client-side by a browser. Additionally, the exploit shows a second trigger path: embedding the uploaded image’s publicLink inside a custom widget’s templateHtml via <object data="{public_link}" type="image/svg+xml">, created through POST /api/widgetType — widget rendering also causes the server to fetch/process the referenced SVG, re-triggering the outbound request. Because the feature requires only a Tenant Admin token (a lower-privileged role than System Admin) rather than any special network permission, this is a meaningful privilege boundary bypass allowing tenants to pivot into the platform’s internal network.
Attack Vector
- Attacker with a valid Tenant Admin bearer token uploads a crafted SVG file to
POST /api/image, embedding an internal target URL (e.g.http://127.0.0.1:5555or a cloud metadata IP) as anxlink:href. - The server processes the SVG server-side, issuing an outbound request to the embedded URL — the first SSRF trigger.
- The script extracts the
publicLinkreturned in the upload response. - The script creates a new custom widget (
POST /api/widgetType) whosetemplateHtmlembeds<object data="{public_link}" type="image/svg+xml">. - Whenever any user views/renders that widget on a dashboard, the platform again fetches the referenced SVG/URL server-side, re-triggering the SSRF on demand.
Impact
An authenticated Tenant Admin can force the ThingsBoard server to make arbitrary outbound HTTP requests, enabling internal network reconnaissance and access to services not exposed to the internet (internal APIs, cloud instance metadata endpoints, other tenants’ or the platform’s internal infrastructure), and repeatable triggering via a persisted dashboard widget.
Environment / Lab Setup
- ThingsBoard server, version < 4.2.1 (tested against 4.2.0)
- A valid Tenant Admin account/bearer token for the target instance
- Attacker-controlled listener to observe the SSRF callback (e.g. `nc -l 5555`)
- Python 3 with the `requests` library:
pip install requests
Proof of Concept
PoC Script
See
thingsboard_4.2.0_ssrf_CVE-2025-34282_exploit.pyandssrf_localhost_5555.svgin this folder.
| |
Detection & Indicators of Compromise
- POST requests to /api/image containing SVG payloads with xlink:href or
<image>/<pattern> elements pointing at internal IP ranges (127.0.0.1, RFC1918,
169.254.169.254, etc.)
- POST requests to /api/widgetType creating widgets with templateHtml containing
<object data="..." type="image/svg+xml"> referencing internally-hosted publicLink URLs
- Outbound HTTP connections initiated from the ThingsBoard server process toward
internal-only hosts/ports shortly after an image upload or widget render
- Unusual widget names such as "SSRF_testing_Poc" or similarly generic/test-sounding
custom widgets in the Widget Library
Signs of compromise:
- Unexpected outbound connections from the ThingsBoard host to internal services or metadata endpoints
- Newly created custom widgets embedding
<object>tags with attacker-controlledpublicLink/SVG references - SVGs in the Image Gallery containing
xlink:hreftargets pointing to non-image, internal, or unusual hosts
Remediation
| Action | Detail |
|---|---|
| Primary fix | Upgrade ThingsBoard to version 4.2.1 or later, which fixes the SSRF |
| Interim mitigation | Restrict/monitor Tenant Admin ability to upload SVG files; sanitize or strip external resource references (xlink:href, |
References
Notes
Mirrored from https://github.com/mathitam/thingsboard-ssrf-cve-2025-34282 on 2026-07-06. Working Python exploit script plus the malicious SVG payload used to trigger the ThingsBoard SSRF, as described; the author’s own README lists the CVSS as 6.9 Medium (differs from the 9.1 figure supplied in the ingestion task — recorded here as provided by the task along with the discrepancy for transparency).
| |