Penetration Test Report (iSEC): iSec Final Open Crypto Audit Project TrueCrypt Security Assessment

Open Crypto Audit Project
TrueCrypt
Security Assessment
Prepared for:
Prepared by:
Andreas Junestam –Security Engineer
Nicolas Guigo – Security Engineer
iSEC Partners Final Report – Open Crypto Audit Project TrueCrypt Page 2 of 32
©2014, iSEC Partners, Inc.
Prepared by iSEC Partners, Inc. for Open Crypto Audit Project. Portions of this document, and
the templates used in its production are the property of iSEC Partners, Inc. and cannot be cop-
ied without permission.
While precautions have been taken in the preparation of this document, iSEC Partners, Inc., the
publisher, and the author(s) assume no responsibility for errors, omissions, or for damages re-
sulting from the use of the information contained herein. Use of iSEC Partners services does not
guarantee the security of a system, or that computer intrusions will not occur.
February 14, 2014 Open Crypto Audit Project Version 1.1
iSEC Partners Final Report – Open Crypto Audit Project TrueCrypt Page 3 of 32
Document Change Log
Version Date Change
0.5 2014-02-12 First draft of document
0.9 2014-02-13 Peer reviewed by Josh Yavor, Mike Ryan, Javed Samuel, and Russ Sevin-
sky
1.0 2014-02-14 Delivered to Open Crypto Audit Project
1.1 2014-03-04 Finalized for publication
February 14, 2014 Open Crypto Audit Project Version 1.1
iSEC Partners Final Report – Open Crypto Audit Project TrueCrypt Page 4 of 32
Table of Contents
1 Executive Summary ............................................................... 5
1.1 iSEC Risk Summary .......................................................................................... 6
1.2 Project Summary .............................................................................................. 7
1.3 Findings Summary ............................................................................................ 7
1.4 Recommendations Summary ........................................................................... 8
2 Engagement Structure ........................................................... 9
2.1 Internal and External Teams ............................................................................ 9
2.2 Project Goals and Scope .................................................................................. 10
3 Detailed Findings ................................................................. 11
3.1 Classifications ................................................................................................... 11
3.2 Vulnerability Overview .................................................................................... 13
3.3 Detailed Vulnerability List .............................................................................. 14
4 Appendices .......................................................................... 25
A Example issues in the bootloader decompressor ........................................... 25
A.1 Out of bounds read in stored() ......................................................... 25
A.2 Out of bounds write in construct() .................................................. 25
A.3 Out of bounds read in decode() ......................................................... 26
B Code quality issues in TrueCrypt ....................................................................... 27
B.1 Signed / unsigned mismatches ............................................................. 27
B.2 Inconsistent integer variable types ....................................................... 28
B.3 Lack of integer overflow protections / checks ...................................... 28
B.4 Use of deprecated, insecure string APIs ............................................... 29
B.5 Suppression of compiler warnings ........................................................ 29
B.6 Use of Zw APIs ....................................................................................... 30
B.7 Other minor issues ................................................................................ 30
B.8 General readability issues ...................................................................... 31
February 14, 2014 Open Crypto Audit Project Version 1.1
iSEC Partners Final Report – Open Crypto Audit Project TrueCrypt Page 5 of 32
1 Executive Summary
Application Summary
Application Name TrueCrypt
Application Version 7.1a
Application Type Disk encryption software
Platform Windows, C / C++
Engagement Summary
Engineers Engaged Two (2)
Engagement Type Security Assessment
Testing Methodology Source code aided security assessment
Vulnerability Summary
Total High severity issues Zero (0)
Total Medium severity issues Four (4)
Total Low severity issues Four (4)
Total vulnerabilities identified Eleven (11) (incl. three (3) Informational)
See Section 3.1 for descriptions of these classifications.
Category Breakdown:
Access Controls 0
Auditing and Logging 0
Authentication 0
Configuration 0
Cryptography 1 ■
Data Exposure 4 ■■■■
Data Validation 3 ■■■
Denial of Service 2 ■■
Error Reporting 1 ■
Patching 0
Session Management 0
Timing 0
February 14, 2014 Open Crypto Audit Project Version 1.1
iSEC Partners Final Report – Open Crypto Audit Project TrueCrypt Page 6 of 32
1.1 iSEC Risk Summary
The iSEC Partners Threat Matrix chart evaluates discovered vulnerabilities according to estimat-
ed user risk. The impact of the vulnerability increases towards the bottom of the chart. The so-
phistication required for an attacker to find and exploit the flaw decreases towards the left of the
chart. The closer a vulnerability is to the chart origin, the greater the risk.
w
o •TC_IOCTL_GET_SYSTEM_DRIVE_DUMP_CONFIG
L
kernel pointer disclosure
•IOCTL_DISK_VERIFY
integer overflow •MainThreadProc() integer
overflow
•TC_IOCTL_OPEN_TEST
multiple issues
•Sensitive information might be
paged out from kernel stacks
•Windows kernel driver uses memset()
k
s to clear sensitive data
i
R
r e •Multiple issues in the bootloader
s decompressor
U
•Weak Volume Header key
derivation algorithm
h
g
iH
Simple Attack Sophistication Difficult
©2008 iSEC Partners, Inc.
February 14, 2014 Open Crypto Audit Project Version 1.1
iSEC Partners Final Report – Open Crypto Audit Project TrueCrypt Page 7 of 32
1.2 Project Summary
The Open Crypto Audit Project1 engaged iSEC Partners to review select parts of the TrueCrypt
7.1a disk encryption software. This included reviewing the bootloader and Windows kernel driv-
er for any system backdoors as well as any other security related issues.
iSEC performed a source code assisted security assessment of the TrueCrypt bootloader and
Windows kernel driver. A breakdown of what areas were included, as well as excluded, can be
found in Section 2.2. The assessment included reviewing source code for the bootloader and
kernel driver as well as hands-on testing. The team also compiled both components and per-
formed limited fuzzing of select interfaces.
The iSEC team reviewed the TrueCrypt 7.1a source code, which is publicly available as a zip ar-
chive (“truecrypt 7.1a source.zip”) at http://www.truecrypt.org/downloads2. The SHA1 hash of
the reviewed zip archive is 4baa4660bf9369d6eeaeb63426768b74f77afdf2. iSEC did not attempt
to create a reproducible build; instead, the team performed hands-on testing against binaries
available from http://www.truecrypt.org/downloads and binaries compiled from the source
code.
Two engineers performed this work in an engagement concluding on February 14th, 2014. All
work was carried out at iSEC’s facilities in Seattle, WA.
1.3 Findings Summary
During this engagement, the iSEC team identified eleven (11) issues in the assessed areas. Most
issues were of severity Medium (four (4) found) or Low (four (4) found), with an additional
three (3) issues having severity Informational (pertaining to Defense in Depth).
Overall, the source code for both the bootloader and the Windows kernel driver did not meet
expected standards for secure code. This includes issues such as lack of comments, use of inse-
cure or deprecated functions, inconsistent variable types, and so