Summary
An authenticated path traversal vulnerability exists in the /api/raw endpoint.
Details
In the raw.py file, there is no proper sensitization of user input before passing it through to FileResponse.
asset_path = f"{ASSETS_BASE_PATH}/{path}" <--- Here
return FileResponse(path=asset_path, filename=path.split("/")[-1])
Any vulnerable (unpatched) version running in it's default configuration is affected.
POC
This POC works on the docker version, or if your assets path is /romm/assets:
https://{URL}/api/raw/assets/..%2f%2f..%2f%2fetc/passwd
https://demo.romm.app/api/raw/assets/..%2f%2f..%2f%2fetc/passwd
This POC will download the passwd file from the remote server, which leaks usernames and group IDs. It could also be changed to /etc/shadow if the server is running as root.
Impact
All instances running an unpatched version are vulnerable. Particularly vulnerable are:
- Instances exposed to/accessible from the open internet (without Tailscale, CF Tunnel, etc)
- Instances running on bare metal (not using Docker, LXC, etc)
- Instances running in "kiosk mode"
- Instances with many user accounts
Mitigation
Upgrading immediately to the earliest patched version (3.10.3) is highly recommended.
Summary
An authenticated path traversal vulnerability exists in the
/api/rawendpoint.Details
In the raw.py file, there is no proper sensitization of user input before passing it through to
FileResponse.Any vulnerable (unpatched) version running in it's default configuration is affected.
POC
This POC works on the docker version, or if your assets path is
/romm/assets:This POC will download the
passwdfile from the remote server, which leaks usernames and group IDs. It could also be changed to/etc/shadowif the server is running as root.Impact
All instances running an unpatched version are vulnerable. Particularly vulnerable are:
Mitigation
Upgrading immediately to the earliest patched version (
3.10.3) is highly recommended.