OwnTracks Recorder — Stored Format String in json_response() via Location tid (CVE-2026-131852)
Published: 2026-11-25 • Researcher: googlesky (Lê Hiếu) — PoC/lab; VulnCheck (disclosure); OwnTracks (vendor)
- Severity
- Critical
- CVE
- CVE-2026-131852
- Category
- web
- Affected product
- OwnTracks Recorder (ot-recorder) — JSON HTTP API in http.c with the bundled Mongoose library
- Affected versions
- All versions before 1.0.5 (NVD range: 0 to < 1.0.5, semver)
- Disclosed
- 2026-11-25
- Patch status
- Patched
Tags
References
- https://nvd.nist.gov/vuln/detail/CVE-2026-131852
- https://www.cve.org/CVERecord?id=CVE-2026-131852
- https://github.com/googlesky/CVE-2026-131852
- https://www.vulncheck.com/advisories/owntracks-recorder-before-1.0.5-format-string-via-stored-tid-value
- https://github.com/owntracks/recorder/commit/64a86050a1ac6cb5f704e296ec9182f750d143c8
- https://github.com/owntracks/recorder/pull/589
- https://github.com/owntracks/recorder/releases/tag/1.0.5
- https://github.com/owntracks/recorder/blob/1.0.4/http.c#L369-L410
Archive entry
intelseclab/poc-archiveOn this page
Metadata
| Field | Value |
|---|---|
| Date Added | 2026-11-25 |
| Last Updated | 2026-11-18 |
| Author / Researcher | googlesky (Lê Hiếu) — PoC/lab; VulnCheck (disclosure); OwnTracks (vendor) |
| CVE / Advisory | CVE-2026-131852 |
| Category | web |
| Severity | Critical |
| CVSS Score | 9.8 — CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (9.3 CVSSv4.0) |
| Status | PoC |
| Tags | format-string, CWE-134, OwnTracks, unauthenticated, stored-input, info-leak, ASLR-bypass, DoS, MQTT, HTTP-API |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | OwnTracks Recorder (ot-recorder) — JSON HTTP API in http.c with the bundled Mongoose library |
| Versions Affected | All versions before 1.0.5 (NVD range: 0 to < 1.0.5, semver) |
| Language / Platform | C; Linux (Debian packages), standalone daemon with HTTP API and MQTT input |
| Authentication Required | No |
| Network Access Required | Yes |
Summary
OwnTracks Recorder before 1.0.5 stores attacker-supplied location data and later re-emits it through a printf-style format string. The JSON response helper in http.c passes the serialized JSON, which includes the attacker-controlled tracker ID, directly as the format argument of the bundled Mongoose output call, so printf specifiers are expanded when the stored record is read back. An unauthenticated attacker can publish a location through POST /pub over HTTP or over MQTT and then read it through GET /api/0/last: pointer specifiers leak live stack and library addresses, defeating ASLR, while write specifiers crash the daemon and, as this lab measured, corrupt the storage into a restart crash loop.
Vulnerability Details
Root Cause
json_response() in http.c serializes the stored record with json_stringify() and then hands the resulting string to Mongoose as a format string:
| |
mg_printf_data() forwards its argument to vsnprintf(), so any % specifier present in user data is interpreted. The location tid (tracker ID) is the cleanest carrier because it is stored verbatim by the publish path and echoed verbatim by /api/0/last. The vendor fix in 1.0.5 (commit 64a86050a1ac6cb5f704e296ec9182f750d143c8) passes it as data — mg_printf_data(conn, "%s", js) — and hardens the sibling sinks emit_xml_line, emit_csv_line, send_status, plus an ns_avprintf 8192-byte truncation bug (> changed to >=).
Attack Vector
Unauthenticated network access to the Recorder HTTP API (default port 8083), or MQTT publish access to the broker that feeds the Recorder. The attacker publishes a location with tid: "%p.%p.%p" (leak) or tid: "%n.%n..." (write/crash) via POST /pub?u=<user>&d=<device>, then issues GET /api/0/last. The value is persisted by the filesystem backend, so one publish poisons every later read. The ?format=xml and ?format=csv read variants traverse the sibling sinks closed by the same patch.
Impact
- Address-space disclosure / ASLR defeat:
%pexpands to live heap, binary and libc pointers in the HTTP response, which is the pre-step of a full exploit chain. - Memory write:
%nwrites through pointers popped from the stack, crashing the daemon with SIGSEGV (observed rc=139) or enabling a controlled write with a shaped stack. - Persistent denial of service: the lab observed that the storage written through the corrupted in-memory state is poisoned, so every subsequent startup crash-loops until the store is cleared. A single unauthenticated publish can knock an instance out permanently.
- NVD rates the issue as potential code execution (C:H/I:H/A:H); the archived PoC stops at the leak and crash primitives and does not ship a complete RCE chain.
Environment / Lab Setup
OS: Linux x86_64, Podman (or Docker); containers on an isolated
cve131852lab network
Target: ot-recorder built from upstream tag 1.0.4 (vulnerable) and
upstream tag 1.0.5 (vendor fix), Debian trixie slim runtime,
filesystem storage, MQTT disabled, HTTP API on port 8083,
supervised with restart + /work/crash.log
Attacker: Python 3.12 (stdlib only) inside the poc container, or any
host with network reachability to the API
Tools: Podman/Docker, Python 3, curlSetup Steps
| |
The build needs outbound HTTPS at image build time (GitHub for the recorder tags, Debian mirrors). The probe mode intentionally corrupts the vulnerable container’s storage, so recreate the container before re-running it.
Proof of Concept
Step-by-Step Reproduction
- Build and start the differential lab —
./run-lab.sh build && ./run-lab.sh upproducesotr-vuln(1.0.4) andotr-fixed(1.0.5) on thecve131852labnetwork. - Confirm persistence with a benign tid — publish a location with a normal
tid, then pollGET /api/0/lastuntil the value is visible (the filesystem backend lands writes asynchronously). - Publish the format string — send a location whose
tidcontains%pspecifiers toPOST /pub?u=alice&d=phone. - Read it back —
GET /api/0/last; on 1.0.4 the stored tid is expanded and pointer-shaped hex appears in the JSON response. On 1.0.5 the specifiers are echoed literally. - Trigger the write primitive (optional, destructive) — publish a tid built from
%nand observe the daemon exit with rc=139 in/work/crash.logand the subsequent crash loop. - Verify with the standalone exploit —
python3 exploit/exploit.py --host=<target> --port=8083exits 1 when pointers are leaked, 0 on a fixed target.
Exploit Code
See
exploit/exploit.py(standalone full-chain leak) andpoc/poc.py(check / exploit / probe / mitigation modes). The lab definition is inlab/lab.Dockerfileandrun-lab.sh; upstream write-up inupstream-README.md.
| |
Expected Output
| |
Detection & Indicators of Compromise
- HTTP requests to
/pub(or MQTT location publishes) whosetid,addrorssidcontains printf specifiers such as%p,%x,%s,%n, or long%<n>csequences. - Responses from
/api/0/last(and?format=xml|csv) containing pointer-shaped hex that was never sent by a legitimate device. - Recorder process exits with rc=139 (SIGSEGV) recorded by the service supervisor or systemd; repeated restarts with the same exit code and a store that keeps crashing on startup.
- Core dumps from ot-recorder inside
vsnprintf/mg_printf_data/json_response, or http.c frames on the crash stack. - Unusual write rates to the recorder store keyed by a single user/device with sequential
tstvalues, typical of an automated probe.
SIEM / IDS rule (example):
| |
Remediation
| Action | Detail |
|---|---|
| Patch | Upgrade OwnTracks Recorder to 1.0.5 or later (vendor commit 64a86050a1ac6cb5f704e296ec9182f750d143c8, PR #589). The fix passes the serialized JSON as data ("%s") and hardens the xml, csv and status sinks. |
| Workaround | Until upgrading, restrict /pub and the read API to trusted networks or put them behind an authenticating reverse proxy; disable anonymous MQTT publish into the Recorder; clear a poisoned store after a crash to break the restart loop. |
| Config Hardening | Bind the HTTP API to localhost or an internal interface (--http-host), firewall port 8083, require MQTT credentials/ACLs, run under a supervisor with restart limits, and monitor exit codes and store integrity. |
References
Notes
Auto-ingested from https://github.com/googlesky/CVE-2026-131852 on 2026-11-25.
Review verdict: genuine exploit-grade PoC, not a detector. It publishes a stored tid carrying printf specifiers and reads it back to obtain real pointer leaks, and it observes the %n write primitive as a daemon SIGSEGV under a supervisor. It does not build a full controlled-write or code-execution chain, so Status is PoC rather than Weaponized; the ASLR leak plus crash are confirmed in the captured evidence.
License: MIT (Copyright (c) 2026 Lê Hiếu), archived with the LICENSE file and attribution. Copied files are the exploit scripts, lab build/run files, Makefile and six captured evidence runs. Excluded: .git, the gitignored *.log files (including evidence/probe-vuln-crash.log referenced by the upstream README), and TRACKING.md (not published upstream).
Limitations: the lab builds with WITH_MQTT=no, so the MQTT publish path described in the CVE is not exercised by the archived PoC, although it shares the same json_response() sink. Probe mode is destructive by design — it corrupts the vulnerable container’s store and induces a crash loop, so only run it against disposable instances. The differential results (leak on 1.0.4, literal echo on 1.0.5) are the upstream author’s captured runs; the code was not executed while archiving. Run only against systems you own or have written authorization to test.
| |