Analysis

Find hardcoded secrets in MeshOS-Repeater firmware

Analysis:
Parsed the ESP32-S3 flash, rebuilt an ELF, decompiled with Ghidra and searched strings/refs for key-like blobs and auth code paths.
Conclusion:
Found two confirmed secrets: OTA API key 7e97c81e7f85a5657a1fcc0d59fc127d (X-MeshOS-Key) and MQTT broker password 8b680d584757980d1808b938cedbccfc (user meshos‑

Tools: todo_write, run_sandbox, skill, skill:ghidra-analysis, inspect_binary, dump_data, semantic_function_search

Run it yourself
MeshOS-Repeater-HeltecV3-v1.6.3-merged.bin

Look through this firmware to find any hardcoded secrets like 16, 24, 32 or 64 byte AES encryption keys or similar

Dr.Binary
todo_write
run_sandbox
run_sandbox

ESP32-S3 merged flash image (8MB): bootloader @0x0, partition table @0x8000, nvs, otadata, app0/app1 (app), spiffs, coredump. Let me carve the partitions and start hunting.

run_sandbox

The merged image is smaller than the partition layout (only app0 is populated — app1/spiffs/coredump lie beyond EOF and are empty). Now let me scan NVS and the app for secret-looking strings.

run_sandbox
run_sandbox

NVS is blank (all 0xFF — freshly imaged). The app is "MeshOS-Repeater 1.6.3 (meshcore.co.uk)" — a MeshCore-compatible repeater. Notable strings already: X-MeshOS-Key, web.pwd=%s, pin=%s. Let me dig deeper.

run_sandbox
run_sandbox

Two 32-hex-char strings found (7e97c81e7f85a5657a1fcc0d59fc127d, 8b680d584757980d1808b938cedbccfc) plus a hardcoded X-MeshOS-Key header. Let me get binary context around each.

run_sandbox

Two plaintext secrets already confirmed:

  1. 7e97c81e7f85a5657a1fcc0d59fc127d — sent as X-MeshOS-Key header to the OTA gateway at http://167.99.90.25:8071/f
  2. 8b680d584757980d1808b938cedbccfc — sits next to the MQTT observer config (167.99.90.25, topic meshos/rpt/%s/rx, a ,"sig":" signing field, username meshos-device)

Now let me look for more: default passwords/PINs, base64-encoded AES keys, and any embedded identity keypair.

run_sandbox
run_sandbox

Confirmed a factory default: "The admin password ... The factory default is password". Let me check the secret string context, the WiFi-AP/WPA2 path, and scan for raw binary AES key blobs (16/32-byte high entropy).

run_sandbox
run_sandbox
run_sandbox

WPA2, admin password shows the fallback AP reuses the admin password. Now let me verify the literal default password, look for other long hex/base64 blobs, and decompile the MQTT/OTA code to characterize the two hex secrets.

run_sandbox
run_sandbox

The web UI says heartbeats are "each signed with its own key" — so the 8b68... string's role needs verification. Let me decompile to see exactly how both hex strings are used.

inspect_binary

The app image is a raw ESP32-S3 Xtensa image (rz-bin can't parse functions from it). Not packed — decompilation is appropriate. Let me dump it with Ghidra.

dump_data
Error calling tool 'dump_data': Ghidra pod finished with phase Failed. Pod log (last 20 lines):
Copying binary to local /tmp/app0.bin...
Opening project app0.bin-3b732e...
Loading binary app0.bin...
Merging project back to /sandbox/projects...
Project flushed.
Traceback (most recent call last):
  File "ProgramLoader.java", line 439, in ghidra.app.util.importer.ProgramLoader$Builder.load
Exception: Java Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/ghidra_scripts/parse_all_functions.py", line 704, in <module>
    with loader.load() as load_results:
         ~~~~~~~~~~~^^
ghidra.app.util.opinion.ghidra.app.util.opinion.LoadException: ghidra.app.util.opinion.LoadException: No load spec found
	at ghidra.app.util.importer.ProgramLoader$Builder.getLoadSpec(ProgramLoader.java:584)
	at ghidra.app.util.importer.ProgramLoader$Builder.load(ProgramLoader.java:469)
	at ghidra.app.util.importer.ProgramLoader$Builder.load(ProgramLoader.java:439)

Ghidra can't load raw ESP images directly. Let me parse the ESP image format myself and rebuild it as an ELF that Ghidra can load.

run_sandbox
run_sandbox

ESP32-S3 layout confirmed: DROM 0x3c150020, IRAM 0x40374000/0x4037cfec, IROM 0x42000020, DRAM 0x3fc991e0. Let me repack this into a proper ELF for Ghidra.

run_sandbox
run_sandbox
run_sandbox

Valid Xtensa ELF created. Now dumping with Ghidra (this may take a while for a 2MB firmware).

dump_data
run_sandbox

9191 functions decompiled. Now let me find the functions referencing both hex secrets.

run_sandbox
run_sandbox
run_sandbox
run_sandbox

Mass file scanning over this mount is too slow. Let me use the JSON metadata and semantic search instead.

run_sandbox
semantic_function_search
semantic_function_search
semantic_function_search

Let me search the single analysis.json file for MQTT/OTA-related functions instead.

run_sandbox
run_sandbox

Ghidra references strings as DAT_<addr>. Let me compute the string vaddrs and grep the dump in parallel.

run_sandbox
run_sandbox
run_sandbox

The MQTT session setup is found (port 0x75b=1883, IP literal). Ghidra labels strings via PTR_s_<name> — let me grep for the sanitized string labels instead.

run_sandbox
run_sandbox
run_sandbox
run_sandbox

Confirmed: 0x4200f21c connects MQTT with username meshos-device and password 8b680d.... Let me verify FUN_42038374 is the MQTT connect call and hunt for the default-password literal.

run_sandbox
run_sandbox
run_sandbox
run_sandbox

MQTT CONNECT builder confirmed — 8b680d... is the hardcoded broker password for username meshos-device. Now checking for the factory-default password literal and any remaining key blobs.

run_sandbox
run_sandbox
run_sandbox

Factory-init function 0x42014b88 confirmed: admin password field is initialized with the literal "password". Final sweep: bootloader secrets + a relaxed raw-blob entropy scan.

run_sandbox
run_sandbox

Three high-entropy 16-byte candidates worth checking: 0x64294, 0x645bc, 0x1fc6c. Let me inspect their surroundings.

run_sandbox

These sit near the AES S-box region — could be mbedtls constants. Let me find what references them.

run_sandbox
run_sandbox

No decompiled references — let me look at ASCII context around these blobs to classify them.

run_sandbox
run_sandbox

No code references found — let me identify the owning module via nearby strings.

run_sandbox

The 0x642xx/0x645xx blobs sit next to WPA/SAE strings — ESP-IDF WiFi library crypto constants. Let me verify by locating literal-pool references to each candidate.

run_sandbox
run_sandbox
run_sandbox

FUN_42023a20 loads four 32-byte constants — let me resolve the literal pool targets and trace this crypto path.

run_sandbox
run_sandbox

These are three 32-byte constants (plus the odd X+31×f string) referenced by app-level code near SHA-256 constants. Let me trace the callers.

run_sandbox
run_sandbox
run_sandbox
run_sandbox
run_sandbox
run_sandbox
run_sandbox

That's X25519/Ed25519 curve constants (I recognize the group order edd3f55c...de14, base point Gx 1ad5258f..., and "0x58,0x66×31" is actually base-point Gy — Ghidra showed it as an ASCII "string"). Not secrets. Same for the WPA/SAE-region blobs. Final check: AirLink channel defaults and any leftover key-like strings.

run_sandbox

Let me quickly verify one adjacent finding (a login handler flagged as bypassing password checks) before writing the report.

run_sandbox
run_sandbox
run_sandbox

Ghidra mislabeled that comparison (the "function" is actually the "Password: " string) — so I'm dropping the bypass claim. One last sweep for auth headers, then I'll write the report.

run_sandbox
todo_write

Hardcoded Secrets in MeshOS-Repeater-HeltecV3-v1.6.3

Firmware: ESP32-S3 merged flash (2,050,576 B) — bootloader @0x0, nvs (blank/all-0xFF), otadata, app0 @0x10000 (1.99 MB, only populated app), app1/spiffs/coredump beyond EOF (empty). App is "MeshOS repeater 1.6.3 (meshcore.co.uk)", esp-idf v4.4.7.

Confirmed hardcoded secrets

1. OTA-gateway API key — 7e97c81e7f85a5657a1fcc0d59fc127d

  • Located in .rodata @ 0x3c161d80 (app0 file offset 0x11d78).
  • Set by function 0x42006b34 (verified in decompiled code):
    FUN_4204e478(auStack_44, PTR_s_X_Target_URL_42000324);
    FUN_4204e478(auStack_34, param_4);              // <url>
    FUN_42038c4c(param_2, auStack_44, auStack_34, 0, 1);
    FUN_4204e478(auStack_44, PTR_s_X_MeshOS_Key_42000328);
    FUN_4204e478(auStack_34, PTR_s_7e97c81e7f85a5657a1fcc0d59fc127d_4200032c);
    FUN_42038c4c(param_2, auStack_44, auStack_34, 0, 1);
    
  • Sent as HTTP header X-MeshOS-Key: 7e97… with X-Target-URL: <url> to the update gateway http://167.99.90.25:8071/f (board tag rpt_heltec_v3, manifest https://meshcore.co.uk/fw/firmware.json). Possession of the firmware grants use of that update service.

2. MQTT observer broker password — 8b680d584757980d1808b938cedbccfc

  • Located @ 0x3c16470f (file offset 0x14707), next to meshos-device, 167.99.90.25 and topic templates.
  • Used in 0x4200f21c (observer connect): FUN_42038374(session, clientId, "meshos-device", "8b680d…") → MQTT CONNECT builder 0x42038138, which sets the flags byte 0xC0 (username+password present) and writes both strings into the packet. Confirmed: username meshos-device, password 8b680d…, broker 167.99.90.25:1883, client ID meshosrpt-<id>, publishes meshos/rpt/<id>/rx & meshos/rpt/<id>/status, subscribes meshos/chat/control. Anyone with this firmware can impersonate a repeater on the observer MQTT network.

3. Factory-default admin password — password

  • Factory-init function 0x42014b88 copies the literal "password" into the admin-password field (offset 0x4c, 16-byte store). Protects the web UI (user admin, HTTP Basic), the TCP CLI (port 23) and app sign-in; the fallback AP (meshosrpt-<id>) reuses it as its WPA2 passphrase when ≥8 chars. The web UI itself says: "The factory default is password, so please change it."

4. Default Bluetooth pairing PIN — 123456

  • Documented in the UI ("6 digits, default 123456") and used as the factory default.

Ruled out (checked, not secrets)

  • No hardcoded 16/24/32/64-byte AES keys. Channel keys and the per-device signing identity ("signed with its own key") are generated/stored per-device — NVS is blank in this image.
  • High-entropy blobs I hunted down are standard crypto constants: Curve25519 group order edd3f55c…de14 (LE), Ed25519 base point Gx 1ad5258f…6921, base point Gy (58 66 66 66… — Ghidra rendered it as the ASCII "string" Xfffffffffffffffffffffffffffffff), curve constant d = a3785913…0352 (used by the X25519 Montgomery ladder at 0x42023768), plus ESP-IDF WPA/SAE library tables near "SAE Hunting and Pecking".

IOCs

TypeValue
IPv4167.99.90.25 (8071/tcp OTA gateway, 1883/tcp MQTT)
HeaderX-MeshOS-Key: 7e97c81e7f85a5657a1fcc0d59fc127d, X-Target-URL
URLshttp://167.99.90.25:8071/f, https://meshcore.co.uk/fw/firmware.json, https://api.meshcore.nz/api/v1/config
MQTTuser meshos-device, pass 8b680d584757980d1808b938cedbccfc, topics `meshos/rpt//rx
Defaultsadmin/web password password, BLE PIN 123456, AP SSID meshosrpt-<id>

Recommendation: rotate the two service credentials (they're burned for every device shipped with this image), move them to per-device provisioning (NVS), and force a password change on first setup instead of the password/123456 defaults.

Artifacts: carved partitions in parts/, Ghidra-decompiled app (parts/app0.elf, 9,191 functions) at ghidra_data/app0.elf/ (key functions: 0x42006b34.c, 0x4200f21c.c, 0x42038138.c, 0x42014b88.c).