CVE-2026-135107: Samba: smb2 pipe transceive allocates maxoutputresponse before the read
AIONLYREPORT package: samba-4.23.5-105.el10 ------ Summary: SMB2 FSCTLPIPETRANSCEIVE allows attacker-sized allocation before named-pipe read (authenticated DoS): an authenticated SMB client can set a large MaxOutputResponse value and force smbd to allocate an attacker-sized buffer before the named-pipe read, causing memory-pressure denial of service. Requirements to exploit: Network reachability to the SMB service, valid SMB credentials, access to IPC$ and a named pipe handle, and the ability to send an SMB2 IOCTL request with sufficient CreditCharge to avoid early rejection. Component affected: samba-4.23.5-105.el10 in source3/smbd/smb2ioctl.c and source3/smbd/smb2ioctlnamedpipe.c, primarily smbdsmb2requestprocessioctl() and smbdsmb2ioctlpipewritedone(). Version affected: samba-4.23.5-105.el10 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:L/PR:L/UI:N/S:U/C:N/I:N/A:H - 6.5 (MEDIUM) AV:N - The issue is reachable over the network via SMB. AC:L - Exploitation requires a crafted SMB2 IOCTL request, but no unusual race or environmental condition is needed beyond supplying a large requested output size and enough SMB2 credits. PR:L - The attacker must authenticate and reach IPC$/a named pipe handle. UI:N - No user interaction is required. S:U - The impact is confined to the Samba service handling the request. C:N - No confidentiality impact is demonstrated by the available evidence. I:N - No integrity impact is demonstrated by the available evidence. A:H - Large attacker-influenced allocations can create substantial memory pressure and service instability, especially with concurrent requests. Impact: Important. Under Red Hat's severity guidance, this is best classified as Important because it allows a remote authenticated user to directly affect availability in a network-facing service by forcing large server-side allocations. It is not Critical because authentication is required and the available evidence does not show code execution, confidentiality impact, or integrity impact. Embargo: yes Reason: The issue provides a short and actionable path to authenticated network service disruption in a commonly exposed service, and coordinated private handling is reasonable until a fixed package is available. Acknowledgement: Aisle Research Vulnerability Details: The SMB2 IOCTL parser reads the client-controlled MaxOutputResponse field from the request body and passes it into the IOCTL state as state->inmaxoutput. In the FSCTLPIPETRANSCEIVE named-pipe path, that value is then used directly to allocate the output buffer before the server issues the pipe read. c / source3/smbd/smb2ioctl.c / inmaxoutputlength = IVAL(inbody, 0x2C); ... subreq = smbdsmb2ioctlsend(..., inmaxoutputlength, ...); ... state->inmaxoutput = inmaxoutput; / source3/smbd/smb2ioctlnamedpipe.c / state->outoutput = datablobtalloc(state, NULL, state->inmaxoutput); ... subreq = npreadsend(..., state->outoutput.data, state->outoutput.length); There is no explicit bound against the negotiated server.maxtrans value in this path before datablobtalloc() executes. The supported impact is availability-only: an authenticated client can trigger large per-request allocations and, particularly with parallel requests, create enough memory pressure to destabilize the service or contribute to OOM behavior. The available evidence does not establish confidentiality, integrity, or code-execution impact. Steps to reproduce: 1. Start the service with SMB2/3 enabled and ensure an authenticated user can access IPC$. 2. Open \\server\IPC$ and create or open a named pipe handle, for example \PIPE\srvsvc. 3. Send an SMB2 IOCTL request with CtlCode = FSCTLPIPETRANSCEIVE, set MaxOutputResponse (request body offset 0x2C) to a large value such as 0x20000000, and set CreditCharge high enough to satisfy the server's SMB2 credit checks. 4. Send the request concurrently from one or more authenticated sessions. 5. Observe rising smbd memory usage and allocation pressure; under sufficient load this can lead to service instability or OOM conditions. Mitigation: Until a fixed package is available, restrict IPC$ and named-pipe access to trusted authenticated users as tightly as operationally possible. Operational controls that reduce client-driven request size or concurrency may lessen memory pressure, but they do not remove the missing bound in the FSCTLPIPETRANSCEIVE path. Proposed Fix: Reject oversized FSCTLPIPETRANSCEIVE output requests before allocating the named-pipe read buffer, using the negotiated per-connection transaction limit as the bound. diff diff --git a/source3/smbd/smb2ioctlnamedpipe.c b/source3/smbd/smb2ioctlnamedpipe.c index 8b8d0dd..e3b0abc 100644 — a/source3/smbd/smb2ioctlnamedpipe.c +++ b/source3/smbd/smb2ioctlnamedpipe.c @@ -133,6 +133,12 @@ static void smbdsmb2ioctlpipewritedone(struct teventreq subreq) return; } + if (state->inmaxoutput > state->smb2req->xconn->smb2.server.maxtrans) { + teventreqnterror(req, NTSTATUSINVALIDPARAMETER); + return; + } + state->outoutput = datablobtalloc(state, NULL, state->inmaxoutput); if (state->inmaxoutput > 0 && teventreqnomem(state->outoutput.data, req)) { ------ This report was generated using AI technology. Always review AI-generated content prior to use
Other sources
An uncontrolled memory allocation flaw has been found in the smbdsmb2ioctlpipewritedone() function in source3/smbd/smb2ioctlnamedpipe.c of the SMB2 named-pipe ioctl handling in the Samba package. The file server reserves memory for a named-pipe response using a size chosen by the client. It does not keep that size within the maximum the client and the server have already agreed. A low-privileged network attacker or user who can open a named pipe can request a very large response. The file server reserves that memory before it reads the pipe and holds it until the request ends. Repeating this on more connections can exhaust memory and keep the file service unavailable while those requests continue.
— NVD
An uncontrolled memory allocation flaw has been found in the smbdsmb2ioctlpipewritedone() function in source3/smbd/smb2ioctlnamedpipe.c of the SMB2 named-pipe ioctl handling in the samba package. The file server reserves memory for a named-pipe response using a size chosen by the client. It does not keep that size within the maximum the client and the server have already agreed. A low-privileged network attacker or user who can open a named pipe can request a very large response. The file server reserves that memory before it reads the pipe and holds it until the request ends. Repeating this on more connections can exhaust memory and keep the file service unavailable while those requests continue.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Until a fixed package is available, restrict IPC$ and named-pipe access to trusted authenticated users as tightly as operationally possible.
Event History
Frequently Asked Questions
Who is exposed to this issue?
Samba file servers that handle SMB2 named-pipe ioctl requests are exposed if a low-privileged user or network attacker can open a named pipe. Exploitation requires access sufficient to establish such a named-pipe request; no user interaction is required.
What is the practical impact of exploitation?
An attacker can request an excessively large named-pipe response, causing the server to reserve memory before reading from the pipe. Repeating requests across connections can exhaust server memory and leave the file service unavailable while the requests remain active.
Is the attack limited to a single connection?
No. The issue can be amplified by repeating oversized requests on multiple connections, increasing memory consumption and the likelihood of service unavailability.