Traccar 5 Remote Code Execution Vulnerabilities
Traccar 5's device image upload feature allowed path traversal through the device's unique ID and the Content-Type header, letting an attacker write files with arbitrary content to any location on the filesystem. This could lead to remote code execution, for example by uploading a crontab file or a Windows shortcut, and guest registration was enabled by default so unauthenticated attackers could exploit it.
Published on horizon3.ai
Attack Blogs, Disclosures
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The application used user-controlled input (device unique ID and Content-Type header) to construct a file path without sanitising path traversal sequences or restricting file extensions.
Impact
An unauthenticated attacker could achieve remote code execution, potentially leading to a reverse shell or system compromise, though some methods require a reboot or user login to trigger.
What the attacker needed
Guest registration enabled (default); network access to the Traccar server
The fix
The maintainer fixed the path traversal in the Content-Type header and restricted file extensions to a known set, and also disabled guest registration by default in Traccar 6.
How it was found
- Register a new user account on the Traccar server.
- Log in with the new account.
- Create a device with a unique ID containing path traversal sequences.
- Upload an image file with a crafted Content-Type header that includes path traversal and a desired filename.
- The uploaded file is written to an arbitrary location on the filesystem.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Traccar is a GPS tracking app. When you upload a picture for a device, the app builds a file path from parts you can control, like the device's ID and the file type. By putting special characters like '../' in those parts, an attacker can make the app save a file outside the intended folder, even in system folders, which can later run code.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.