Description
In the Linux kernel, the following vulnerability has been resolved:

scsi: target: iscsi: Validate CHAP_R length before base64 decode

chap_server_compute_hash() allocates client_digest as
kzalloc(chap->digest_size) and then, for BASE64-encoded responses,
passes chap_r directly to chap_base64_decode() without checking whether
the input length could produce more than digest_size bytes of output.

chap_base64_decode() writes to the destination unconditionally as long
as there is input to consume. With MAX_RESPONSE_LENGTH set to 128 and
the "0b" prefix stripped by extract_param(), up to 127 base64 characters
can reach the decoder. 127 characters decode to 95 bytes. For SHA-256
(digest_size=32) this overflows client_digest by 63 bytes; for MD5
(digest_size=16) the overflow is 79 bytes.

The length check at line 344 fires after the write has already happened.

The HEX branch in the same switch statement already validates the length
up front. Apply the same approach to the BASE64 branch: strip trailing
base64 padding characters, then reject any input whose data length
exceeds DIV_ROUND_UP(digest_size * 4, 3) before calling the decoder.

Stripping trailing '=' before the comparison handles both padded and
unpadded encodings. chap_base64_decode() already returns early on '=',
so the full original string is still passed to the decoder unchanged.

The mutual CHAP path decodes CHAP_C into initiatorchg_binhex, which is
kzalloc(CHAP_CHALLENGE_STR_LEN). extract_param() caps initiatorchg at
CHAP_CHALLENGE_STR_LEN characters, so at most CHAP_CHALLENGE_STR_LEN-1
base64 characters reach the decoder. The maximum decoded size,
DIV_ROUND_UP((CHAP_CHALLENGE_STR_LEN-1) * 3, 4), is less than
CHAP_CHALLENGE_STR_LEN, so no overflow is possible there. A comment is
added at the call site to document this.
Published: 2026-07-19
Score: 9.8 Critical
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability resides in the iSCSI target implementation of the Linux kernel. It occurs when a CHAP_R response is processed: the kernel allocates a digest buffer sized for the expected SHA‑256 or MD5 hash, then decodes the Base64‑encoded response into that buffer without verifying that the decoded size fits. Because up to 127 Base64 characters can produce 95 decoded bytes, the write overruns the allocated buffer by 63 bytes for SHA‑256 or 79 bytes for MD5, corrupting kernel memory. This buffer overflow can be leveraged to execute arbitrary code with kernel privileges, resulting in a remote code execution vector.

Affected Systems

Every Linux kernel build that includes the iSCSI target module is at risk if the patch adding a length check before Base64 decoding has not been applied. Distributions shipping the default kernel with an iSCSI target enabled and still using the pre‑patch code path are vulnerable. The issue exists in any kernel version that does not contain the specific commit introducing the validation logic.

Risk and Exploitability

The CVSS score of 9.8 indicates critical severity. The EPSS is below 1 %, indicating low current exploitation activity, and the vulnerability is not listed in the CISA KEV catalog. An attacker must be able to deliver a specially crafted CHAP_R value to a target configured for CHAP authentication; only network reachability to the iSCSI target is required. If successful, the overflow allows control of kernel execution flow, enabling arbitrary code execution with elevated privileges.

Generated by OpenCVE AI on August 4, 2026 at 18:22 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply a kernel update that includes the patch adding a length check before Base64 decoding for CHAP_R responses.
  • If a kernel upgrade cannot be performed immediately, disable CHAP authentication on the iSCSI target or restrict the iSCSI service to a trusted, isolated network segment to prevent exposure of the vulnerable code path.
  • Continuously monitor authentication logs for anomalous CHAP_R values and limit network access to the iSCSI target to known, trusted hosts, adding an additional defense layer while remediation is pending.

Generated by OpenCVE AI on August 4, 2026 at 18:22 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Ubuntu USN Ubuntu USN USN-8593-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-8603-1 Linux kernel (Azure) vulnerabilities
Ubuntu USN Ubuntu USN USN-8618-1 Linux kernel vulnerabilities
History

Sun, 26 Jul 2026 09:00:00 +0000

Type Values Removed Values Added
Weaknesses CWE-119
CWE-787

Wed, 22 Jul 2026 00:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-805
References
Metrics threat_severity

None

threat_severity

Important


Wed, 22 Jul 2026 00:00:00 +0000

Type Values Removed Values Added
Weaknesses CWE-119
CWE-787

Mon, 20 Jul 2026 14:45:00 +0000

Type Values Removed Values Added
Metrics cvssV3_1

{'score': 9.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}


Sun, 19 Jul 2026 15:30:00 +0000

Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: scsi: target: iscsi: Validate CHAP_R length before base64 decode chap_server_compute_hash() allocates client_digest as kzalloc(chap->digest_size) and then, for BASE64-encoded responses, passes chap_r directly to chap_base64_decode() without checking whether the input length could produce more than digest_size bytes of output. chap_base64_decode() writes to the destination unconditionally as long as there is input to consume. With MAX_RESPONSE_LENGTH set to 128 and the "0b" prefix stripped by extract_param(), up to 127 base64 characters can reach the decoder. 127 characters decode to 95 bytes. For SHA-256 (digest_size=32) this overflows client_digest by 63 bytes; for MD5 (digest_size=16) the overflow is 79 bytes. The length check at line 344 fires after the write has already happened. The HEX branch in the same switch statement already validates the length up front. Apply the same approach to the BASE64 branch: strip trailing base64 padding characters, then reject any input whose data length exceeds DIV_ROUND_UP(digest_size * 4, 3) before calling the decoder. Stripping trailing '=' before the comparison handles both padded and unpadded encodings. chap_base64_decode() already returns early on '=', so the full original string is still passed to the decoder unchanged. The mutual CHAP path decodes CHAP_C into initiatorchg_binhex, which is kzalloc(CHAP_CHALLENGE_STR_LEN). extract_param() caps initiatorchg at CHAP_CHALLENGE_STR_LEN characters, so at most CHAP_CHALLENGE_STR_LEN-1 base64 characters reach the decoder. The maximum decoded size, DIV_ROUND_UP((CHAP_CHALLENGE_STR_LEN-1) * 3, 4), is less than CHAP_CHALLENGE_STR_LEN, so no overflow is possible there. A comment is added at the call site to document this.
Title scsi: target: iscsi: Validate CHAP_R length before base64 decode
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-08-05T12:36:55.369Z

Reserved: 2026-07-19T07:54:57.018Z

Link: CVE-2026-63886

cve-icon Vulnrichment

No data.

cve-icon NVD

No data.

cve-icon Redhat

Severity : Important

Publid Date: 2026-07-19T00:00:00Z

Links: CVE-2026-63886 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-04T18:30:12Z

Weaknesses
  • CWE-805

    Buffer Access with Incorrect Length Value