Summary
Mercusys AC12G (EU) V1 routers with firmware AC12G(EU)_V1_200909 expose 128 bytes of uninitialized buffer content when handling specific UPnP POST requests lacking a SOAPAction header on port 1900.
An unauthenticated attacker on the adjacent network can trigger this flaw to read fragments of the device's internal memory, potentially leaking sensitive data such as configuration details or residual credentials.
Affected context
The vulnerability occurs in the UPnP (Universal Plug and Play) service running on Mercusys AC12G (EU) V1 routers with the referenced firmware.
It is triggered when the device receives crafted HTTP POST requests on the UPnP port (UDP/TCP 1900) that omit the SOAPAction header.
In this situation, the request handling logic returns 128 bytes from an uninitialized response buffer, which may contain remnants of previous data in memory.
The issue is relevant in environments where UPnP is enabled and reachable from the local network or wireless segment.
Exploit preconditions
- Attack surface: UPnP service on port 1900 exposed to the local or adjacent network (e.g., LAN/WLAN clients).
- Required access: Network adjacency only; no authentication or valid device credentials are required.
- Trigger point: Sending a specially formed HTTP POST request to the UPnP endpoint without a SOAPAction header.
- Why exploitation is possible: The UPnP request handler constructs a response using a buffer that is not fully initialized, and then returns its contents to the requester. As a result, arbitrary 128-byte slices of memory can be disclosed when the malformed request path is exercised.
Why this happens
This issue stems from improper handling of memory in the UPnP request processing code.
A response buffer is allocated but not fully initialized before being sent back to the client, leaving prior memory contents intact.
When an unexpected or malformed input (a POST without SOAPAction) is received, error-handling or alternative code paths fail to populate the buffer completely and still return it over the network.
This aligns with CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where internal memory contents, potentially including configuration data or transient secrets, are unintentionally disclosed to unauthenticated network clients.
Potential impact
- Disclosure of partial device memory contents that may contain fragments of configuration data or logs.
- Leakage of sensitive values such as portions of admin credentials, Wi-Fi keys, or session-related information if they reside in nearby memory.
- Assistance to attackers in mapping internal structures or behavior of the firmware, aiding further vulnerability research or exploitation.
- Potential exposure of implementation details that can lower the barrier for more advanced attacks against the router or similar devices.
General mitigation guidance
Effective mitigation centers on controlling the exposure of UPnP and enforcing safe memory-handling patterns:
- Restrict external exposure of UPnP: Limit UPnP accessibility to trusted internal segments only, or disable UPnP entirely where it is not required.
- Harden input and error handling paths: Ensure that all network-facing handlers consistently initialize response buffers and avoid returning uninitialized memory, including on malformed or unexpected requests.
- Apply least-privilege design for services: Run auxiliary services such as UPnP with minimal privileges and constrained access to sensitive data, reducing the impact of any information leak.
- Reduce sensitive data lifetime in memory: Avoid keeping high-value secrets in long-lived buffers and clear them once no longer needed, minimizing the chance they appear in unintentionally exposed memory regions.
- Network segmentation and access controls: Use firewall rules, VLANs, and wireless isolation to constrain which clients can reach the UPnP service, lowering the practical exploitation surface.
How teams detect issues like this
Detection approaches focus on both code-level analysis and network-level observation:
- Static analysis and code review:
- Flag patterns where buffers are allocated but not explicitly initialized before use in network responses.
- Review error-handling branches for early returns that may bypass proper initialization or sanitation of output structures.
- Enforce coding standards requiring deterministic initialization and zeroing of buffers exposed to untrusted clients.
- Dynamic testing and fuzzing:
- Fuzz UPnP and other management endpoints with malformed or incomplete HTTP/SOAP requests to identify unexpected data in responses.
- Capture and inspect responses for non-deterministic byte patterns that may indicate leaks of uninitialized memory.
- Network monitoring:
- Monitor internal network traffic for suspicious or repeated POST requests to port 1900 lacking standard UPnP headers.
- Use intrusion detection/prevention systems with signatures for anomalous UPnP traffic patterns.
- Automated security tooling:
- Integrate firmware analysis tools and protocol fuzzers into the development and QA pipeline to catch memory exposure issues before release.

