edk2/NetworkPkg/IScsiDxe
Syed Mohammed Nayyar 24788b6190 NetworkPkg/IScsiDxe: bound value length in IScsiBuildKeyValueList
IScsiBuildKeyValueList parses the data segment of a received iSCSI
login, text or CHAP response into key=value pairs. After locating '='
within the remaining length, it sets KeyValuePair->Value and calls
AsciiStrLen(Value) to measure the value before subtracting it from the
remaining length. AsciiStrLen has no length cap, and the data segment
copied from the received PDU (AllocatePool(Len) + NetbufQueCopy of the
data-segment length) is not guaranteed to be NUL-terminated.

A malicious or redirecting target can send a data segment whose final
value lacks a trailing NUL (e.g. the 3 bytes "X=Y"), so AsciiStrLen
reads past the end of the segment allocation, an attacker-controlled
out-of-bounds read. The SafeUint32Sub bound check only runs after the
over-read.

Replace AsciiStrLen(Value) with AsciiStrnLenS(Value, Len), capping the
scan to the bytes remaining from Value onward. An unterminated value
then returns Len and the existing SafeUint32Sub rejects the segment.
The single change covers all three callers (login redirect, operational
parameter negotiation and CHAP).

Signed-off-by: Syed Mohammed Nayyar <jmestwa@gmail.com>
2026-06-30 16:34:46 +00:00
..
ComponentName.c NetworkPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
IScsiAuthenticationInfo.c NetworkPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
IScsiCHAP.c NetworkPkg: SECURITY PATCH CVE-2023-45237 2024-05-24 15:48:52 +00:00
IScsiCHAP.h NetworkPkg: Replace include guards with #pragma once 2026-02-23 21:01:28 +00:00
IScsiConfig.c NetworkPkg/IScsiDxe: Fix AttemptName cleared on loading defaults 2026-06-10 20:21:51 +00:00
IScsiConfig.h NetworkPkg: Replace include guards with #pragma once 2026-02-23 21:01:28 +00:00
IScsiConfigNVDataStruc.h NetworkPkg: Replace include guards with #pragma once 2026-02-23 21:01:28 +00:00
IScsiConfigStrings.uni NetworkPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:15 -07:00
IScsiConfigVfr.vfr NetworkPkg/IScsiDxe: Fix AttemptName cleared on loading defaults 2026-06-10 20:21:51 +00:00
IScsiDhcp.c NetworkPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
IScsiDhcp.h NetworkPkg: Replace include guards with #pragma once 2026-02-23 21:01:28 +00:00
IScsiDhcp6.c NetworkPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
IScsiDhcp6.h NetworkPkg: Replace include guards with #pragma once 2026-02-23 21:01:28 +00:00
IScsiDns.c NetworkPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
IScsiDns.h NetworkPkg: Replace include guards with #pragma once 2026-02-23 21:01:28 +00:00
IScsiDriver.c NetworkPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
IScsiDriver.h NetworkPkg: Replace include guards with #pragma once 2026-02-23 21:01:28 +00:00
IScsiDxe.inf NetworkPkg/IScsiDxe: fix potential integer overflow in IScsiBinToHex() 2021-06-09 17:25:03 +00:00
IScsiDxe.uni NetworkPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:15 -07:00
IScsiDxeExtra.uni NetworkPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:15 -07:00
IScsiExtScsiPassThru.c NetworkPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
IScsiIbft.c NetworkPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
IScsiIbft.h NetworkPkg: Replace include guards with #pragma once 2026-02-23 21:01:28 +00:00
IScsiImpl.h NetworkPkg: Replace include guards with #pragma once 2026-02-23 21:01:28 +00:00
IScsiInitiatorName.c NetworkPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
IScsiMisc.c NetworkPkg: SECURITY PATCH CVE-2023-45237 2024-05-24 15:48:52 +00:00
IScsiMisc.h NetworkPkg: Replace include guards with #pragma once 2026-02-23 21:01:28 +00:00
IScsiProto.c NetworkPkg/IScsiDxe: bound value length in IScsiBuildKeyValueList 2026-06-30 16:34:46 +00:00
IScsiProto.h NetworkPkg: Replace include guards with #pragma once 2026-02-23 21:01:28 +00:00