CVE-2025-53521: F5 BIG-IP APM apmd Stack Buffer Overflow Pre-Auth Remote Code Execution
HERMES THREAT SCORE & PERIMETER GATEWAY EXPOSURE
Target:F5 BIG-IP Access Policy Manager (APM) - apmd Process Standard CVSS v3.1 rates this flaw at 9.8 (Critical). The Hermes Threat Score assigns an operational score of 97 (CRITICAL), reflecting active in-the-wild exploitation cataloged by CISA KEV and persistent global attack campaigns tracked by The Shadowserver Foundation in partnership with national CSIRTs. BIG-IP APM devices reside directly on external enterprise network boundaries, terminating SSL-VPN tunnels, handling single sign-on (SSO), and controlling access to internal core subnets. Because the apmd daemon executes with high OS privileges and exploitation requires zero credentials, successful attacks give adversaries immediate kernel-level and root foothold into corporate networks, enabling lateral movement and backdoor implantation.
CVE-2025-53521: F5 BIG-IP APM apmd Stack Buffer Overflow Pre-Auth Remote Code ExecutionVULNERABILITY
Enterprise application delivery controller, SSL VPN, and traffic management proxy operating system (TMOS).
๐ Why is this related? (Evidence & Provenance)
“Confirmed security vulnerability in F5 BIG-IP Access Policy Manager documented in Hermes dossier.”
- [vulnerability_report]
- [government_confirmation]CISA verified active exploitation in the wild and mandated federal remediation deadline in KEV entry. — Source: Cybersecurity & Infrastructure Security Agency (CISA): CISA Adds CVE-2026-59822 to Known Exploited Vulnerabilities Catalog (Reliability: VERY_HIGH)
Cascading multi-stage attack chaining context injection, autonomous loop planning, and un-sandboxed execution sinks to achieve persistent root shell compromise on host machines.
๐ Why is this related? (Evidence & Provenance)
“CVE-2025-53521 weaponizes the agentic attack pattern formalized under AAP-007.”
- [technical_analysis]Pillar Security demonstrated that executing export BASH_ENV in Auto-Run causes bash to source hostile payloads upon subsequent commands. — Source: Pillar Security Research: Bypassing Cursor Auto-Run: When Shell Built-ins Lead to Host RCE (Reliability: HIGH)
1. Technical Context & Affected Software Matrix
Section titled โ1. Technical Context & Affected Software MatrixโF5 BIG-IP Access Policy Manager (APM) provides secure, identity-aware access management, SSL-VPN termination, and SAML/OAuth federation for large enterprise and government network boundaries.
| Parameter | Technical Specification | Operational Impact |
|---|---|---|
| CVE Identifier | CVE-2025-53521 | Global vulnerability tracking reference |
| Vendor Advisory | K000156741 | F5 Security Advisory |
| CISA KEV Status | Active (Added 2026-03-27) | Mandated federal remediation & active threat monitoring |
| Vulnerability Class | Stack-based Buffer Overflow (CWE-121) | Memory corruption leading to code execution |
| Vulnerable Daemon | /usr/bin/apmd | Native C++ access policy engine running under TMOS |
| Affected Branches | 17.1.0 - 17.1.1, 16.1.4 - 16.1.5, 15.1.10 | Standard APM deployments with active virtual servers |
| Fixed Releases | 17.1.1.3, 16.1.5.1, 15.1.10.4 | Engineering hotfixes issued by F5 Networks |
| Exploitation State | In-The-Wild Exploitation | Backdoors and webshells deployed on edge appliances |
2. In-Depth Technical Decomposition
Section titled โ2. In-Depth Technical DecompositionโF5 BIG-IP Architecture & The apmd Daemon
Section titled โF5 BIG-IP Architecture & The apmd DaemonโOn F5 TMOS, traffic arriving on a virtual server with an APM profile is passed from the Traffic Management Microkernel (TMM) to userspace support daemons. The Access Policy Daemon (apmd) is responsible for state machine progression, credential validation, access session cookies (MRHSession), and endpoint posture assessment.
EXTERNAL UNTRUSTED CLIENT (Internet) โ โ TLS Handshake + Initial Session Packet โผ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Traffic Management โ โ Microkernel (TMM) โ โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโ โ Internal IPC (mptcp / socket) โผ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ apmd (Access Policy) โ โ - Session Parser โ <--- [CVE-2025-53521 Vulnerability] โ - Stack Buffer Overwrite โ Unbounded memcpy() on stack โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโ โ Arbitrary Return Address Hijack โผ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ Root Execution / Shell โ โ (/bin/sh spawned) โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโRoot Cause Analysis: Unbounded Stack Copy
Section titled โRoot Cause Analysis: Unbounded Stack CopyโDuring session initialization, apmd processes client-supplied metadata fields within an internal framing structure. When parsing specific protocol sub-headers, the parser reads a 16-bit length parameter from the network packet without verifying that the value does not exceed the fixed stack destination buffer size:
/* Conceptual representation of vulnerable parsing routine in apmd */void apm_process_client_session_token(const uint8_t *packet_data, size_t packet_len) { char session_identifier_buf[256]; uint16_t token_len;
if (packet_len < 2) return; token_len = *(uint16_t *)(packet_data);
/* VULNERABILITY: No boundary check comparing token_len against sizeof(session_identifier_buf) */ /* An attacker specifying token_len = 0x0800 overwrites 2048 bytes of the execution stack */ memcpy(session_identifier_buf, packet_data + 2, token_len);
apm_session_lookup(session_identifier_buf);}Because apmd runs under Linux-based TMOS with root privileges, overflowing this stack buffer enables the adversary to overwrite saved frame pointers and return addresses ($rip / $rbp on x86_64). When combined with Return-Oriented Programming (ROP) gadgets located in non-randomized shared libraries or partial address overwrites, execution is redirected into payload staging routines.
3. Attack Vectors & Real-World Exploitation Chain
Section titled โ3. Attack Vectors & Real-World Exploitation ChainโThreat actors observed by The Shadowserver Foundation and national cybersecurity authorities execute a multi-phase weaponization chain:
sequenceDiagram autonumber participant Attacker as Adversary (Internet) participant VIP as F5 Virtual Server (TMM) participant Daemon as apmd Access Daemon participant Host as TMOS Linux Underlay
Attacker->>VIP: TLS handshake on TCP/443 (APM VIP) Attacker->>VIP: Send crafted access policy request with oversized token VIP->>Daemon: Forward session setup payload via IPC Daemon->>Daemon: Trigger stack overflow in apm_process_client_session_token Daemon->>Host: Hijack instruction pointer, execute shellcode as root Host-->>Attacker: Spawn reverse TCP/TLS shell to C2 Attacker->>Host: Deploy persistent webshell under /var/netstorage/- Reconnaissance & Identification: Attackers scan for exposed HTTP/HTTPS virtual servers responding with BIG-IP APM session cookies (
MRHSessionor/my.policyURI redirects). - Pre-Authentication Trigger: An HTTP POST or raw protocol packet containing the oversized session token is delivered to the APM endpoint. No valid user credentials or pre-existing sessions are required.
- Payload Staging & Shell Spawn: The exploit overflows the stack in
apmd, pivots the stack pointer, and executes a syscall sequence invoking/bin/shor downloading an in-memory binary payload. - Post-Exploitation & Persistence: Threat actors drop persistent backdoors into web directories such as
/var/netstorage/or/shared/and access the localtmshshell to extract administrative credentials, SSL private keys, and session secrets.
4. Forensic Triage & Detection Engineering
Section titled โ4. Forensic Triage & Detection Engineeringโtitle: F5 BIG-IP apmd Crash Loop or Unexpected Child Process Spawnid: a8c2b510-410e-4a61-9c84-f55352100001status: experimentaldescription: Detects unusual child processes spawned by the F5 BIG-IP apmd daemon or segmentation faults indicating CVE-2025-53521 exploitation.references: - https://my.f5.com/manage/s/article/K000156741 - https://dashboard.shadowserver.org/author: Hermes Codex Cyber Intelligencedate: 2026-09-29logsource: product: linux service: syslogdetection: selection_crash: message|contains: - "apmd" - "segfault" - "general protection fault" selection_spawn: parent_process|endswith: "/apmd" process_path|endswith: - "/bin/sh" - "/bin/bash" - "/usr/bin/curl" - "/usr/bin/python" condition: selection_crash or selection_spawnfalsepositives: - Software upgrade crash transientslevel: criticaltags: - attack.initial_access - attack.t1190 - attack.execution - attack.t1059// Azure Sentinel / Microsoft Defender for Endpoint// Detect abnormal child process activity spawned by apmd on BIG-IP or syslog ingestSyslog| where ProcessName == "apmd" or SyslogMessage has "apmd"| where SyslogMessage has_any ("segfault", "SIGSEGV", "core dump", "killed by signal 11") or SyslogMessage matches regex @"apmd\[\d+\]:.*(sh|bash|curl|python|nc)"| project TimeGenerated, HostName, ProcessName, SyslogMessage| sort by TimeGenerated desc#!/bin/bash# Emergency forensic triage script for F5 BIG-IP appliances
echo "=== 1. Checking core files for apmd crashes ==="ls -lah /var/core/ | grep -E "apmd|core"
echo "=== 2. Reviewing recent apmd error messages ==="grep -E "segfault|SIGSEGV|core dump" /var/log/apm /var/log/messages 2>/dev/null | tail -n 25
echo "=== 3. Inspecting active processes spawned under apmd ==="ps auxf | grep -A 5 -E "apmd" | grep -E "sh|bash|python|curl|nc"
echo "=== 4. Checking web root and scratch directories for suspicious files ==="find /var/netstorage/ /shared/tmp/ /var/tmp/ -type f -mtime -7 -lsalert tcp any any -> any [443,8443] ( msg:"HERMES - F5 BIG-IP APM apmd Stack Buffer Overflow Attempt (CVE-2025-53521)"; flow:established,to_server; content:"POST"; http_method; content:"/my.policy"; http_uri; content:"MRHSession"; http_cookie; dsize:>2048; threshold:type limit, track by_src, count 1, seconds 60; classtype:attempted-admin; sid:202553521; rev:1;)5. Remediation Strategy & Mitigation Controls
Section titled โ5. Remediation Strategy & Mitigation Controlsโ-
Apply Official Engineering Hotfix: Upgrade affected BIG-IP systems to patched TMOS maintenance releases immediately:
- 17.1.x: Upgrade to
17.1.1.3or later. - 16.1.x: Upgrade to
16.1.5.1or later. - 15.1.x: Upgrade to
15.1.10.4or later.
- 17.1.x: Upgrade to
-
Isolate Virtual Servers with APM Profiles: If hotfix installation cannot be performed immediately, restrict network access to virtual servers hosting APM access policies using upstream network firewall access lists (ACLs) or perimeter filtering rules.
-
Revoke and Rotate Compromised Credentials: If forensic indicators confirm an
apmdcore dump or unexpected child process execution:- Re-key all SSL/TLS certificates and private keys hosted on the compromised appliance.
- Invalidate all Active Directory, RADIUS, or LDAP service account passwords utilized by APM authentication profiles.
- Rotate BIG-IP administrative passwords and revoke active session tokens.