CVE-2026-85977: Libtirpc: libtirpc: denial of service via unbounded memory allocation during portmapper response decoding
A flaw was found in libtirpc. A remote attacker can exploit this vulnerability by sending specially crafted PMAPPROCDUMP replies to a client application that uses the pmapgetmaps() function against an attacker-controlled host. This unbounded decoding can lead to excessive memory and CPU allocation, causing the client process to experience a Denial of Service (DoS) due to resource exhaustion.
Other sources
AIONLYREPORT package: libtirpc-1.3.7-2.1.hum1 ------ Summary: Unbounded pmaplist decoding can cause memory exhaustion (DoS): attacker-controlled PMAPPROCDUMP replies can drive unbounded decode-time allocation in xdrpmaplist() and exhaust memory or CPU in the client process. Requirements to exploit: An attacker must be able to make a libtirpc consumer call pmapgetmaps() against an attacker-controlled host, or otherwise supply the PMAPPROCDUMP response on that path. No authentication or post-request user interaction is required, but the vulnerable client-side portmapper path must be used by the consuming application. Component affected: libtirpc-1.3.7-2.1.hum1 portmapper/XDR decode path in src/pmapprot2.c (xdrpmaplist()), reachable from src/pmapgetmaps.c (pmapgetmaps()) Version affected: libtirpc-1.3.7-2.1.hum1, when the pmapgetmaps() / PMAPPROCDUMP client decode path is exercised Patch available: no released package fix established; proposed patch included below Version fixed: unknown Upstream coordination: Not notified. CVSS: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H - 5.9 (MEDIUM) AV:N - The malicious PMAPPROCDUMP response is delivered over the network to a client using pmapgetmaps(). AC:H - Exploitation depends on the victim using this specific client path against an attacker-controlled or spoofed endpoint; once that precondition holds, the payload is straightforward. PR:N - No authentication is required. UI:N - No additional user interaction is required after the vulnerable request is made. S:U - The impact is limited to the vulnerable client process and its resources. C:N - No confidentiality impact is established by the available evidence. I:N - No integrity impact is established by the available evidence. A:H - A long attacker-controlled list can consume substantial memory and CPU, causing the client to hang, fail allocation, or be terminated. Impact: Moderate. This is a real availability issue, but the available evidence supports a usage-dependent client-side path rather than a broadly exposed server path in the package itself. Under Red Hat's severity guidance, that makes the issue less broadly exploitable than the typical remote DoS cases rated Important, and there is no evidence of confidentiality, integrity, or system-compromise impact. Embargo: no Reason: This is an availability-only flaw in a client-side, usage-dependent path with straightforward short-term mitigations, so immediate public handling appears appropriate. Acknowledgement: Aisle Research Vulnerability Details: pmapgetmaps() uses xdrpmaplist() to decode PMAPPROCDUMP replies. In xdrpmaplist(), loop termination depends entirely on the decoded moreelements value, and no maximum node count or byte budget is enforced: c for (; { moreelements = (boolt)(rp != NULL); if (! xdrbool(xdrs, &moreelements)) return (FALSE); if (! moreelements) return (TRUE); if (! xdrreference(xdrs, (caddrt )rp, (uint)sizeof(struct pmaplist), (xdrproct)xdrpmap)) return (FALSE); rp = (freeing) ? next : &((rp)->pmlnext); } During XDRDECODE, xdrreference() allocates a new struct pmaplist node whenever the pointer is NULL: c case XDRDECODE: pp = loc = (caddrt) memalloc(size); if (loc == NULL) { warnx("xdrreference: out of memory"); return (FALSE); } memset(loc, 0, size); break; This makes both allocation count and decode work peer-controlled. A responder that keeps sending moreelements=TRUE with additional struct pmap records can force repeated allocations until the client slows significantly, fails allocation, or is killed for resource exhaustion. The available transport code does not show a total decode budget in this path; the receive timeout is applied per read/poll cycle, so continued input can continue to drive work. Steps to reproduce: 1. Build or use a libtirpc consumer with the portmapper client path enabled and create a small client that calls pmapgetmaps() against a host you control. 2. Run a malicious or mock rpcbind/portmapper service on TCP/111 that returns a valid PMAPPROCDUMP reply body containing many repetitions of bool TRUE followed by one struct pmap record, with a final bool FALSE only after a very long list or not until resource exhaustion is reached. 3. Observe client memory and CPU consumption while the reply is decoded through xdrpmaplist(). 4. Increase the number of returned elements; the client eventually becomes slow, fails allocation, or is terminated by the OOM killer. 5. As a validation step, add a local decode cap and confirm the same payload is rejected quickly. Mitigation: Until a fix is available, avoid calling pmapgetmaps() against untrusted or attacker-influenced endpoints. If this functionality is required, add a local maximum node or allocation budget for xdrpmaplist() decoding, or isolate the caller so failure only affects a constrained helper process. Proposed Fix: Add an explicit decode-time limit for the number of pmaplist nodes accepted by xdrpmaplist(), and fail decoding once the limit is exceeded. diff diff --git a/src/pmapprot2.c b/src/pmapprot2.c — a/src/pmapprot2.c +++ b/src/pmapprot2.c @@ -38,6 +38,10 @@ #include <rpc/xdr.h> #include <rpc/pmapprot.h> +#ifndef PMAPLISTDECODEMAXNODES +#define PMAPLISTDECODEMAXNODES 1024U +#endif + boolt xdrpmaplist(XDR xdrs, struct pmaplist rp) { @@ -53,6 +57,7 @@ xdrpmaplist(XDR xdrs, struct pmaplist rp) boolt moreelements; int freeing; struct pmaplist next = NULL; / pacify gcc / + uint decodednodes = 0; freeing = (xdrs->xop == XDRFREE); @@ -67,6 +72,12 @@ xdrpmaplist(XDR xdrs, struct pmaplist rp) if (! moreelements) return (TRUE); + if (xdrs->xop == XDRDECODE) { + if (++decodednodes > PMAPLISTDECODEMAXNODES) { + return (FALSE); + } + } + if (freeing) next = &((rp)->pmlnext); if (! xdrreference(xdrs, (caddrt )rp, ------ This report was generated using AI technology. Always review AI-generated content prior to use
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Until a fix is available, avoid calling pmap_getmaps() against untrusted or attacker-influenced endpoints.
- Compensating control
Add a local decode-time cap in xdr_pmaplist() for XDR_DECODE, defining PMAPLIST_DECODE_MAX_NODES as 1024U and returning FALSE when the decoded node count exceeds that limit.
Event History
Frequently Asked Questions
Which systems are realistically exposed to this issue?
Client applications that use libtirpc's pmap_getmaps() function and query portmapper information from an attacker-controlled host are exposed. The affected path is the portmapper/XDR decoder, specifically xdr_pmaplist().
What must an attacker do to trigger the denial of service?
The attacker must cause the client to receive a specially crafted PMAPPROC_DUMP response on the pmap_getmaps() path, typically by controlling the queried host. No authentication or additional user interaction is required after the request, but the application must use this client-side portmapper operation.
What is the impact on a vulnerable client?
The crafted response can cause unbounded memory and CPU allocation while decoding the pmaplist. This can exhaust client-process resources and result in denial of service.