# Is This A Joke? In The Auth Header? (F5 BIG-IP UnAuth Heap-Overflow to RCE CVE-2026-94127)

Unauthenticated heap overflow in F5 BIG-IP APM OAuth userinfo endpoint via oversized Authorization header, leading to function-pointer hijack and RCE.

- Payout: Research
- Severity: critical
- Program: F5 BIG-IP APM
- Found by (vendor credit): F5
- Write-up by: Sina Kheirkhah
- Disclosed: 2026-09-23
- CVE: CVE-2026-94127
- Write-up quality: 8/10
- Original: https://labs.watchtowr.com/is-this-a-joke-in-the-auth-header-f5-big-ip-unauth-heap-overflow-to-rce-cve-2026-94127/
- Library page: https://bugbountylibrary.com/r/blog%3Alabs-watchtowr-com-is-this-a-joke-in-the-auth-header-f5-big-ip-unauth-heap-overflow-to-rce-cve-2026-94127
- Tags: area:devices domain:network impact:rce kind:research platform:research sev:critical tech:linux technique:chained technique:reverse-engineering technique:source-review vuln:auth-bypass vuln:memory-corruption vuln:rce

**Target:** BIG-IP APM OAuth endpoint /f5-oauth2/v1/userinfo (tmm64)
**Root cause:** The OAuth userinfo handler allocates a 0x4100 heap buffer but copies the Authorization header value without a length check, overflowing the heap. Patch adds a `v20 > 0x4100` bound check.
**Steps:**
1. Configure BIG-IP APM with an OAuth profile exposing /f5-oauth2/v1/userinfo.
2. Send `GET /f5-oauth2/v1/userinfo HTTP/1.1` with `Authorization: Bearer AAAA...` exceeding 0x4100 bytes.
3. Observe crash in ufree on corrupted heap metadata (r14=0x41414141).
4. Heap groom so an object with a callback function pointer lands at buffer+0x4ff8.
5. Overflow overwrites the callback pointer; on invocation, stack-pivot through gadgets (no PIE, base 0x400000).
6. ret2plt to open/append `/etc/bigstart/scripts/tmm.finish` with `/usr/bin/touch /watchTowr.txt;` to bypass SELinux blocking exec.
**How found:** Patch-diffed tmm64 between 21.1.0 and hotfix 21.1.0.2 with Diaphora (172882 functions); spotted new `Authorization header too big.` check and memcpy_wrapper size bound, revealing missing length check on Authorization header copy.
**Exploitation:** Unauthenticated attacker sends oversized Bearer token to OAuth userinfo endpoint; heap overflow corrupts adjacent object's callback function pointer at buffer+0x4ff8; stack pivot into ROP chain; direct execvp blocked by SELinux, so instead open+append to the tmm.finish hook script that runs on crash, achieving code execution as the tmm process.
**Escalation:** Chained heap overflow -> function pointer hijack -> ROP -> SELinux bypass via writable crash-hook script to gain command execution.
**Insight:** When patch-diffing large ELF binaries, grep new error strings like 'too big' — they often mark the exact missing bounds check. Also, on SELinux-hardened appliances, look for crash-hook scripts (e.g. /etc/bigstart/scripts/*.finish) as a writable execution primitive when exec is blocked.

## Proof of concept (copied exactly from the original report)

**Oversized Authorization header request triggering overflow**

```
GET /f5-oauth2/v1/userinfo HTTP/1.1
Host: bigip
Authorization: Bearer AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
Connection: close
```

**ret2plt open/write to tmm.finish hook script**

```
fd = open("/etc/bigstart/scripts/tmm.finish", O_WRONLY | O_APPEND);
write(fd, "/usr/bin/touch /watchTowr.txt;", 30);
```

**execvp ret2plt chain attempt**

```
execvp(
 "/bin/sh",
 (char *[]) { "sh", "-c", "touch /watchTowr.txt", NULL }
);
```

