REDHAT-BUG-2478979: Medium severity libtirpc vulnerability
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
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Add a decode-time cap in xdr_pmaplist() during XDR_DECODE: track decoded_nodes and reject decoding once more than PMAPLIST_DECODE_MAX_NODES (1024U) pmaplist nodes are received.
- Compensating control
Until a fix is available, avoid calling pmap_getmaps() against untrusted or attacker-influenced endpoints.
Event History
Frequently Asked Questions
Which deployments are realistically exposed?
Exposure is limited to applications that consume libtirpc and use the client-side pmap_getmaps() path to process a PMAPPROC_DUMP response. The affected decode logic is in the portmapper/XDR path, specifically xdr_pmaplist().
What must an attacker control to exploit this issue?
An attacker must cause a libtirpc consumer to call pmap_getmaps() against an attacker-controlled host, or otherwise provide the PMAPPROC_DUMP response on that path. No authentication or user interaction is required after the request is made.
Is an application affected simply because libtirpc is installed?
No. The vulnerable behavior requires the application to exercise the pmap_getmaps() / PMAPPROC_DUMP client decode path. The available information does not establish whether this path is used in a default configuration.
Is a released fix available?
No released package fix has been established for libtirpc-1.3.7-2.1.hum1. A proposed patch is noted, but the fixed version is unknown.