Go to file
Daniel Axtens f407a45bd3 net/http: Fix OOB write for split http headers
GRUB has special code for handling an http header that is split
across two packets.

The code tracks the end of line by looking for a "\n" byte. The
code for split headers has always advanced the pointer just past the
end of the line, whereas the code that handles unsplit headers does
not advance the pointer. This extra advance causes the length to be
one greater, which breaks an assumption in parse_line(), leading to
it writing a NUL byte one byte past the end of the buffer where we
reconstruct the line from the two packets.

It's conceivable that an attacker controlled set of packets could
cause this to zero out the first byte of the "next" pointer of the
grub_mm_region structure following the current_line buffer.

Do not advance the pointer in the split header case.

Fixes: CVE-2022-28734

Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2022-06-08 12:41:03 +02:00
asm-tests asm-tests/i386-pc: Check that movl is 5 bytes. 2016-09-28 20:31:04 +03:00
build-aux Import grub2_2.04~rc1.orig.tar.xz 2019-05-14 10:20:03 +01:00
conf gnulib/regcomp: Fix uninitialized re_token 2021-03-02 15:54:16 +01:00
docs minilzo: Update to minilzo-2.10 2021-11-29 00:07:08 +00:00
grub-core net/http: Fix OOB write for split http headers 2022-06-08 12:41:03 +02:00
include net/tftp: Prevent a UAF and double-free from a failed seek 2022-06-08 12:41:03 +02:00
m4 Import grub2_2.06.orig.tar.xz 2021-09-24 10:34:42 +01:00
po Import grub2_2.06.orig.tar.xz 2021-09-24 10:34:42 +01:00
tests tests/ahci: Change "ide-drive" deprecated QEMU device name to "ide-hd" 2021-09-27 20:09:39 +01:00
themes/starfield Starfield theme. 2012-02-23 17:21:38 +01:00
unicode * unicode: Import Unicode 6.0 data. 2011-12-25 16:17:25 +01:00
util util/mkimage: Some fixes to PE binaries section size calculation 2021-09-27 20:09:39 +01:00
ABOUT-NLS Import grub2_2.04~rc1.orig.tar.xz 2019-05-14 10:20:03 +01:00
acinclude.m4 kern/efi: Add initial stack protector implementation 2021-03-02 15:54:19 +01:00
aclocal.m4 Import grub2_2.06.orig.tar.xz 2021-09-24 10:34:42 +01:00
AUTHORS 2005-09-03 Yoshinori K. Okuji <okuji@enbug.org> 2005-09-03 16:54:27 +00:00
autogen.sh autogen: Replace -iname with -ipath in find command 2020-05-15 15:35:59 +02:00
BUGS * BUGS: New file. 2011-01-11 00:06:01 +01:00
ChangeLog Import grub2_2.06.orig.tar.xz 2021-09-24 10:34:42 +01:00
ChangeLog-2015 Autogenerate ChangeLog from git changelog. 2015-01-24 17:29:50 +01:00
config-util.h.in Import grub2_2.06.orig.tar.xz 2021-09-24 10:34:42 +01:00
config.h.in Add configure option to reduce visual clutter at boot time 2021-09-27 20:09:38 +01:00
configure Import grub2_2.06.orig.tar.xz 2021-09-24 10:34:42 +01:00
configure.ac add /u/s/fonts/truetype/dejavu to the DejaVu fonts search paths 2021-09-27 20:09:39 +01:00
COPYING 2007-07-22 Yoshinori K. Okuji <okuji@enbug.org> 2007-07-21 23:32:33 +00:00
coreboot.cfg * coreboot.cfg: Add missing file. 2013-11-20 00:52:23 +01:00
geninit.sh automake commit without merge history 2010-05-06 11:34:04 +05:30
gentpl.py build: Fix GRUB i386-pc build with Ubuntu gcc 2020-03-31 12:17:02 +02:00
INSTALL Minimise writes to EFI variable storage 2021-09-27 20:09:39 +01:00
linguas.sh linguas: Don't skip ko.po. 2017-02-04 00:06:57 +01:00
Makefile.am Makefile: Make libgrub.pp depend on config-util.h 2020-03-10 21:39:53 +01:00
Makefile.in Import grub2_2.06.orig.tar.xz 2021-09-24 10:34:42 +01:00
Makefile.util.am Import grub2_2.06.orig.tar.xz 2021-09-24 10:34:42 +01:00
Makefile.util.def Minimise writes to EFI variable storage 2021-09-27 20:09:39 +01:00
Makefile.utilgcry.def Import grub2_2.02~beta3.orig.tar.xz 2016-09-18 17:40:00 +01:00
NEWS Release 2.06 2021-06-08 16:28:15 +02:00
README SECURITY: Add SECURITY file 2021-06-08 14:24:34 +02:00
stamp-h.in Import grub2_2.02~beta3.orig.tar.xz 2016-09-18 17:40:00 +01:00
THANKS 2009-12-11 Robert Millan <rmh.grub@aybabtu.com> 2009-12-11 22:44:47 +00:00
TODO TODO: Remove obsolete link 2016-02-12 17:51:52 +01:00

This is GRUB 2, the second version of the GRand Unified Bootloader.
GRUB 2 is rewritten from scratch to make GNU GRUB cleaner, safer, more
robust, more powerful, and more portable.

See the file NEWS for a description of recent changes to GRUB 2.

See the file INSTALL for instructions on how to build and install the
GRUB 2 data and program files.

See the file MAINTAINERS for information about the GRUB maintainers, etc.

If you found a security vulnerability in the GRUB please check the SECURITY
file to get more information how to properly report this kind of bugs to
the maintainers.

Please visit the official web page of GRUB 2, for more information.
The URL is <http://www.gnu.org/software/grub/grub.html>.

More extensive documentation is available in the Info manual,
accessible using 'info grub' after building and installing GRUB 2.

There are a number of important user-visible differences from the
first version of GRUB, now known as GRUB Legacy. For a summary, please
see:

  info grub Introduction 'Changes from GRUB Legacy'