An **uncontrolled memory allocation** flaw has been found in the smbd_smb2_ioctl_pipe_write_done() function in source3/smbd/smb2_ioctl_named_pipe.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.
AI_ONLY_REPORT
package: samba-4.23.5-105.el10
------
Summary: SMB2 `FSCTL_PIPE_TRANSCEIVE` 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/smb2_ioctl.c`
and `source3/smbd/smb2_ioctl_named_pipe.c`, primarily
`smbd_smb2_request_process_ioctl()` and `smbd_smb2_ioctl_pipe_write_done()`.
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->in_max_output`. In the `FSCTL_PIPE_TRANSCEIVE`
named-pipe path, that value is then used directly to allocate the output
buffer before the server issues the pipe read.
```c
/* source3/smbd/smb2_ioctl.c */
in_max_output_length = IVAL(inbody, 0x2C);
...
subreq = smbd_smb2_ioctl_send(..., in_max_output_length, ...);
...
state->in_max_output = in_max_output;
/* source3/smbd/smb2_ioctl_named_pipe.c */
state->out_output = data_blob_talloc(state, NULL, state->in_max_output);
...
subreq = np_read_send(..., state->out_output.data,
state->out_output.length);
```
There is no explicit bound against the negotiated `server.max_trans` value
in this path before `data_blob_talloc()` 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 = FSCTL_PIPE_TRANSCEIVE`, 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 `FSCTL_PIPE_TRANSCEIVE` path.
Proposed Fix: Reject oversized `FSCTL_PIPE_TRANSCEIVE` 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/smb2_ioctl_named_pipe.c
b/source3/smbd/smb2_ioctl_named_pipe.c
index 8b8d0dd..e3b0abc 100644
— a/source3/smbd/smb2_ioctl_named_pipe.c
+++ b/source3/smbd/smb2_ioctl_named_pipe.c
@@ -133,6 +133,12 @@ static void smbd_smb2_ioctl_pipe_write_done(struct
tevent_req *subreq)
return;
}
+ if (state->in_max_output > state->smb2req->xconn->smb2.server.max_trans) {
+ tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
+ return;
+ }
+
state->out_output = data_blob_talloc(state, NULL, state->in_max_output);
if (state->in_max_output > 0 &&
tevent_req_nomem(state->out_output.data, req)) {
```
------
This report was generated using AI technology. Always review AI-generated
content prior to use
AI_ONLY_REPORT package: samba-4.23.5-105.el10 ------ Summary: SMB2 `FSCTL_PIPE_TRANSCEIVE` 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/smb2_ioctl.c` and `source3/smbd/smb2_ioctl_named_pipe.c`, primarily `smbd_smb2_request_process_ioctl()` and `smbd_smb2_ioctl_pipe_write_done()`. 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->in_max_output`. In the `FSCTL_PIPE_TRANSCEIVE` named-pipe path, that value is then used directly to allocate the output buffer before the server issues the pipe read. ```c /* source3/smbd/smb2_ioctl.c */ in_max_output_length = IVAL(inbody, 0x2C); ... subreq = smbd_smb2_ioctl_send(..., in_max_output_length, ...); ... state->in_max_output = in_max_output; /* source3/smbd/smb2_ioctl_named_pipe.c */ state->out_output = data_blob_talloc(state, NULL, state->in_max_output); ... subreq = np_read_send(..., state->out_output.data, state->out_output.length); ``` There is no explicit bound against the negotiated `server.max_trans` value in this path before `data_blob_talloc()` 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 = FSCTL_PIPE_TRANSCEIVE`, 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 `FSCTL_PIPE_TRANSCEIVE` path. Proposed Fix: Reject oversized `FSCTL_PIPE_TRANSCEIVE` 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/smb2_ioctl_named_pipe.c b/source3/smbd/smb2_ioctl_named_pipe.c index 8b8d0dd..e3b0abc 100644 — a/source3/smbd/smb2_ioctl_named_pipe.c +++ b/source3/smbd/smb2_ioctl_named_pipe.c @@ -133,6 +133,12 @@ static void smbd_smb2_ioctl_pipe_write_done(struct tevent_req *subreq) return; } + if (state->in_max_output > state->smb2req->xconn->smb2.server.max_trans) { + tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER); + return; + } + state->out_output = data_blob_talloc(state, NULL, state->in_max_output); if (state->in_max_output > 0 && tevent_req_nomem(state->out_output.data, req)) { ``` ------ This report was generated using AI technology. Always review AI-generated content prior to use