diff options
| author | Sachin Agrawal <sachin.agrawal@intel.com> | 2016-08-02 16:46:31 -0700 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2016-09-06 15:06:51 -0400 |
| commit | d241bbbdbfb98b4f878342ef180e3994205b170a (patch) | |
| tree | 704b3289992096a3126f0702f62492d63166bbbd /Cryptlib/OpenSSL/crypto/rand/rand_unix.c | |
| parent | 04d581c303064d1c2d0dc6ff1bb30c7399a72f16 (diff) | |
| download | efi-boot-shim-d241bbbdbfb98b4f878342ef180e3994205b170a.tar.gz efi-boot-shim-d241bbbdbfb98b4f878342ef180e3994205b170a.zip | |
Use authenticode signature length from WIN_CERTIFICATE structure.
Authenticode Certificate length is available in Certificate Table
(inside PE header) and also in signature header(WIN_CERTIFICATE) itself.
Code in 'check_backlist()' method uses length from signature header,
whereas, AuthenticodeVerify() call inside 'verify_buffer()' method uses
the length in signature header. This causes a security vulnerability issue :
Good Scenario : Assume shim1.crt is used for signing grub.efi and
shim1.crt is embedded inside shim.efi. Also, assume shim1.crt got
compromised and therefore it was added in 'dbx' database. Now, when
shim.efi will attempt to load grub.efi, it will fail loading with
log message "Binary is blacklisted" because 'check_blacklist' call
will detect the presence of 'shim1.crt' in 'dbx'.
Vulnerable Scenario : Similar as above. Add 'shim1.crt' in dbx database.
Also, tamper the earlier signed grub.efi file by placing 0x0000 in the
WIN_CERTIFICATE.dwLength.
(Open grub.efi/vmlinuz signed binary with hex editor.
Go to 0x128 address and read out the address from 0x128 until
0x12B in little Indian order from right to left.
Jump to the address from 0x128 address area.
First 8bytes are the signature header area which consist of
signature size(4bytes), revision(2bytes) and type(2bytes).
So tamper the first 4 bytes for signature size and save the binary.
)
With this tampered grub.efi, shim.efi loads it successfully because
'check_blacklist()' call fails to detect the presence of shim1.crt in 'dbx'
database.
Signed-off-by: Sachin Agrawal <sachin.agrawal@intel.com>
Diffstat (limited to 'Cryptlib/OpenSSL/crypto/rand/rand_unix.c')
0 files changed, 0 insertions, 0 deletions
