[IVIZ-08-008] LILO Security Model bypass exploiting wrong BIOS API usage

Hash: SHA1

- -----------------------------------------------------------------------
[ iViZ Security Advisory 08-008 25/08/2008 ]
- -----------------------------------------------------------------------
iViZ Techno Solutions Pvt. Ltd.
- -----------------------------------------------------------------------

* Title: LILO Security Model bypass exploiting wrong BIOS API
* Date: 25/08/2008
* Software: LILO

- --[ Synopsis:

The password checking routine of LILO fails to sanitize the
BIOS keyboard buffer before AND after reading passwords.

- --[ Affected Software:

* LILO 22.6.1 (current) and all previous versions

- --[ Technical description:

LILO's pre-boot authentication routines use the BIOS API to
read user input via the keyboard. The BIOS internally copies the
keystrokes in a RAM structure called the BIOS Keyboard buffer
inside the BIOS Data Area. This buffer is not flushed after use,
resulting in potential plain text password leakage once the OS
is fully booted, assuming the attacker can read the password at
physical memory location 0x40:0x1e. It is also possible for a root
user to reboot the computer by instrumenting the BIOS keyboard
buffer in spite of the full disk encryption.

- --[ Impact:

1) Plain text password disclosure.
Required privileges to perform this operation are OS dependent,
from unprivileged users under Windows (any), to root under most

2) A privileged attacker able to write to the MBR and knowing the
password (for instance thanks to 1), is able to reboot the computer
in spite of the password prompted at boot time (and in spite of
disk encryption) by initializing the BIOS keyboard buffer with the
correct password (using an intermediary bootloader that will in turn
run LILO).

- --[ Full Technical Whitepaper


- --[ Vendor response:

* No Response from author in spite of multiple solicitations.

* vendor-sec@xxxxxx has been intimated and distribution makers are
working on separate fixes.

- --[ Credits:

This vulnerability was discovered by Security Researcher
Jonathan Brossard from iViZ Techno Solutions Pvt. Ltd.

- --[ Disclosure timeline:

* First private disclosure to vendor on July 15th 2008
* Contacted vendor-sec@xxxxxx on July 29th 2008
* First Public disclosure at Defcon 16 on August 10th 2008

- --[ Reference:

Version: GnuPG v1.4.7 (MingW32)


Relevant Pages

  • Re: writing to a partition
    ... boot loader used by LILO, when executed, moves _itself_ to address 0x96a00, ... as the initial stage (the "primary boot ... So you have to learn exactly how the raw bios calls work. ... you can't do anything else unless you can display the results. ...
  • Re: GRUB wont boot Suse 8.2 (fresh install)
    ... LILO is more verbose with BIOS error messages. ... "Write-protected disk". ... If you are booting from a large IDE disk, ...
  • Re: LILO fatal error when writing MBR
    ... Warning: Kernel & BIOS return differing head/sector geometries for device ... Lilo SHOULD grumble. ... but will install my friend grub later. ...
  • Re: Lilo Installation Fehlerhaft: 010101
    ... auf der Ersten Festplatte Windows ME zu installieren auf der 2ten ... Suse Linux 6.4. Beide Installationen verliefen eigentlich gut Linux ... Naja nach einem neustart kommen allerdings statt Lilo nur lauter nullen ... disk is seen by the BIOS first. ...
  • Re: Trying to boot Linux from my second Hard Disk.
    ... disk MBR. ... Latest Lilo does the job. ... disk 2 == bios 0x80 ...