]> xenbits.xensource.com Git - people/aperard/ovmf.git/commitdiff
NetworkPkg: Ip6Dxe: SECURITY PATCH CVE-2023-45231 Patch
authorDoug Flick <dougflick@microsoft.com>
Thu, 25 Jan 2024 21:54:48 +0000 (05:54 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 6 Feb 2024 19:24:26 +0000 (19:24 +0000)
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4536

Bug Overview:
PixieFail Bug #3
CVE-2023-45231
CVSS 6.5 : CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
CWE-125 Out-of-bounds Read

Out-of-bounds read when handling a ND Redirect message with truncated
options

Change Overview:

Adds a check to prevent truncated options from being parsed
+  //
+  // Cannot process truncated options.
+  // Cannot process options with a length of 0 as there is no Type
field.
+  //
+  if (OptionLen < sizeof (IP6_OPTION_HEADER)) {
+    return FALSE;
+  }

Cc: Saloni Kasbekar <saloni.kasbekar@intel.com>
Cc: Zachary Clark-williams <zachary.clark-williams@intel.com>
Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com>
Reviewed-by: Saloni Kasbekar <saloni.kasbekar@intel.com>
NetworkPkg/Ip6Dxe/Ip6Option.c

index 199eea124dfeddac6f1a1ce5e7d5103193b04723..8718d5d8756acfa7d61dc4214eb87504657fafe9 100644 (file)
@@ -137,6 +137,14 @@ Ip6IsNDOptionValid (
     return FALSE;\r
   }\r
 \r
+  //\r
+  // Cannot process truncated options.\r
+  // Cannot process options with a length of 0 as there is no Type field.\r
+  //\r
+  if (OptionLen < sizeof (IP6_OPTION_HEADER)) {\r
+    return FALSE;\r
+  }\r
+\r
   Offset = 0;\r
 \r
   //\r