summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/Workspace/MetaFileParser.py
diff options
context:
space:
mode:
authorjmestwa-coder <jmestwa@gmail.com>2026-05-30 05:34:50 +0300
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2026-06-19 00:59:02 +0300
commit9bf69ed7ed03d88535a43987e5b8105406b42d57 (patch)
treedb69813937091aa0891c42c1da5900d1e1a38dab /BaseTools/Source/Python/Workspace/MetaFileParser.py
parent3b61f4d266ba8e8a4c320a06295637b01f098c2b (diff)
downloadedk2-9bf69ed7ed03d88535a43987e5b8105406b42d57.tar.xz
NetworkPkg/Dhcp6Dxe: bound IA inner option length to buffer
Dhcp6SeekInnerOptionSafe() reads the IA_NA/IA_TA option-len field from a received datagram and only validates it against the fixed minimums, never against OptionLen (the bytes actually remaining in the packet). A reply can declare an option-len up to 0xFFFF while the real buffer is only the 16-byte (IA_NA) or 8-byte (IA_TA) minimum, so the returned inner length is far larger than the buffer. That length is then passed as SeekLen to Dhcp6SeekOption(), which walks ReadUnaligned16() cursors up to Buf + SeekLen and reads past the end of the packet allocation, an attacker-controlled out-of-bounds read. Bound the declared inner length against OptionLen minus the IA header size in both the IA_NA and IA_TA branches, rejecting over-declared options with EFI_DEVICE_ERROR. Parenthesize DHCP6_MIN_SIZE_OF_IA_NA so the subtraction in that bound binds correctly. Add host tests covering the over-declared, off-by-one, and exact-boundary cases for both IA_NA and IA_TA. Signed-off-by: jmestwa-coder <jmestwa@gmail.com>
Diffstat (limited to 'BaseTools/Source/Python/Workspace/MetaFileParser.py')
0 files changed, 0 insertions, 0 deletions