Where
-Infinity
0
Severity
4

A flaw was found in cyrus-sasl's SCRAM server mechanism. When a client sends a client-final message containing channel-binding data and the server application has not registered channel-binding data (the default for most cyrus-sasl-based services), the server dereferences a NULL pointer in plugins/scram.c before verifying the client proof, crashing the server process. The upstream fix (commit 45d6633, released in cyrus-sasl 2.1.28) adds a NULL guard on that branch, but it is absent from the Red Hat Enterprise Linux 7, 8, and 9 cyrus-sasl packages.

First published (updated )
Severity
7.5
Buffer Overflow
AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H

A heap-based buffer overflow flaw was found in Cyrus SASL. The addtochallenge() function in the DIGEST-MD5 plugin computes the size of the buffer needed for a challenge/response field before DIGEST-MD5 quoting is applied, but does not recompute that size when quoting (escaping special characters) makes the value longer. The under-sized buffer is then passed to strcat(), causing a heap-based out-of-bounds write whose size depends on attacker-controlled input. A malicious or on-path DIGEST-MD5 (or HTTP Digest) server can trigger this flaw in a connecting client by supplying a crafted challenge field, such as realm or nonce, most likely resulting in a crash of the client application.

1 / 3
Source: NVD
First published (updated )
Severity
4
Buffer Overflow

AIONLYREPORT package: cyrus-sasl-2.1.28-29.el10 ------ Summary: Heap buffer overflow in addtochallenge() when quoting increases value length: A malicious server or peer can trigger a client-side heap overflow in Cyrus SASL during DIGEST-MD5 or HTTP Digest authentication by sending challenge fields with many escapable characters so the quoted value grows beyond the size calculated before allocation. Requirements to exploit: The attacker must control a malicious server or peer that a Cyrus SASL client authenticates to using DIGEST-MD5 or HTTP Digest. They must supply a challenge containing a field that is later re-emitted with needquotes=TRUE (for example nonce or opaque) and many escapable characters. This is a client-side issue during challenge handling, not the reverse server-side direction. Component affected: cyrus-sasl (plugins/digestmd5.c, client-side addtochallenge() used by DIGEST-MD5/HTTP Digest response generation) Version affected: cyrus-sasl-2.1.28-29.el10 (confirmed); the vulnerable logic likely predates this package version, but earlier affected versions were not confirmed here. Patch available: no Version fixed (if any already): unknown Upstream coordination: Not yet notified. This report is the initial triage. CVSS: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - 8.8 (HIGH) AV:N - The issue is triggered by attacker-controlled challenge data received over a network authentication exchange. AC:L - No race or unusual conditions are required beyond use of the affected DIGEST-MD5 or HTTP Digest client path. PR:N - The attacker needs no prior privileges on the victim system. UI:R - A victim must initiate or complete authentication with the malicious server or peer. S:U - The overflow occurs within the client process that constructs the response. C:H - Reasonable worst-case impact for exploitable heap corruption is disclosure of client-accessible data. I:H - Reasonable worst-case impact for exploitable heap corruption is modification or code execution in the client context. A:H - Heap corruption can crash the client and may permit broader process compromise. Impact: Likely Important. This is a client-side memory-safety flaw reachable from attacker-controlled network input during DIGEST-MD5 or HTTP Digest authentication. A malicious server or peer can at least crash a vulnerable client, and reasonable worst-case impact includes stronger compromise in the client context if the overflow is exploitable. The need for the victim to authenticate to the malicious peer keeps this below Critical. Embargo: yes Reason: No upstream fix is known yet, and public disclosure before a fix is available would expose clients that still use DIGEST-MD5 or HTTP Digest to malicious servers or peers. Acknowledgement: Aisle Research Steps to reproduce: 1. Build cyrus-sasl with AddressSanitizer or another memory sanitizer. 2. Exercise the client-side DIGEST-MD5 or HTTP Digest code path so execution reaches makeclientresponse() / addtochallenge(). 3. From a malicious server or peer, send a challenge containing a field that will be re-emitted with needquotes=TRUE (for example nonce or opaque) and many escapable characters such as repeated \" and . 4. Trigger response generation by allowing the client to continue the authentication exchange. 5. Observe a heap-buffer-overflow at strcat(str, quoted) in addtochallenge() under the sanitizer. Mitigation: Avoid or disable DIGEST-MD5 and HTTP Digest when authenticating to untrusted servers or peers until a fix is available.

Prefer alternative authentication mechanisms that do not use this code path where feasible.

Apply an upstream or vendor fix once available.

Vulnerability Details

addtochallenge() computes newlen from the unquoted input length. When escaping is needed for " or \, quote() returns a longer string. The code updates valuesize after quoting, but reuses the stale pre-quote newlen when calling plugbufalloc(), then appends the expanded string with strcat(): c valuesize = strlen((char ) value); newlen = (unsigned) (curlen + 1 + namesize + 2 + valuesize + 2); ... valuesize = strlen(quoted); ret = plugbufalloc(utils, str, buflen, newlen); if (ret == SASLOK) { strcat(str, quoted); } Because plugbufalloc() only guarantees the requested size, a buffer that was exactly sized for the unquoted value can overflow when the quoted value becomes longer. Most relevant CWE IDs: CWE-131 Incorrect Calculation of Buffer Size

CWE-122 Heap-Based Buffer Overflow

CWE-787 Out-of-Bounds Write

Proposed Fix

Recompute newlen after quoting based on the current output length plus the expanded quoted value length, allocate using that recomputed size, and update curlen from the actual resulting string length instead of reusing the stale pre-quote size. ------ This report was generated using AI technology. Always review AI-generated content prior to use

First published (updated )

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203