Bug 2585000
| Summary: | CVE-2026-135107 samba: samba: SMB2 pipe transceive allocates MaxOutputResponse before the read [fedora-43] | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | TEJ RATHI <trathi> |
| Component: | samba | Assignee: | Guenther Deschner <gdeschner> |
| Status: | NEW --- | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 43 | CC: | abokovoy, anoopcs, asn, gdeschner, pfilipen, sbose, ssorce |
| Target Milestone: | --- | Keywords: | Security, SecurityTracking |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | {"flaws": ["927aedb2-237f-434a-89a6-9f10a1c23cd3"]} | ||
| Fixed In Version: | Doc Type: | --- | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | --- | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 2472623 | ||
Disclaimer: Community trackers are created by Red Hat Product Security team on a best effort basis. Package maintainers are required to ascertain if the flaw indeed affects their package, before starting the update process. 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 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. 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