Penetration Test Report (iSEC): Mailvelope iSEC Final v1.2

Open Technology Fund
Mailvelope Firefox Ex-
tension
Application Penetration Test
Prepared for:
Prepared by:
Mark Manning – Senior Security Engineer
Cassie Park – Security Engineer
iSEC Partners Final Report Mailvelope Page 2 of 28
©2014, iSEC Partners, Inc.
Prepared by iSEC Partners, Inc. for Open Technology Fund. Portions of this document and the
templates used in its production are the property of iSEC Partners, Inc. and cannot be copied
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.
June 2, 2014 Open Technology Fund Version 1.2
iSEC Partners Final Report Mailvelope Page 3 of 28
Table of Contents
1 Executive Summary ............................................................... 4
1.1 iSEC Risk Summary .......................................................................................... 5
1.2 Project Summary .............................................................................................. 6
1.3 Findings Summary ............................................................................................ 6
1.4 Recommendations Summary ........................................................................... 6
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 Mozilla Firefox Security Considerations ........................................................ 25
A.1 Summary ............................................................................................... 25
A.2 Security Model ...................................................................................... 25
A.3 Malicious Extensions............................................................................. 25
A.4 Recommendations ................................................................................ 26
B Input and output validation improvements ...................................................... 27
B.1 Summary ............................................................................................... 27
B.2 Security Measures ................................................................................. 27
B.3 Improvements ....................................................................................... 27
June 2, 2014 Open Technology Fund Version 1.2
iSEC Partners Final Report Mailvelope Page 4 of 28
1 Executive Summary
Application Summary
Application Name Mailvelope
Application Version 0.8.1
Application Type Browser Extension
Platform Firefox
Engagement Summary
Dates April 28 – May 9, 2014
Consultants Engaged Two
Total Engagement Time Four person weeks
Engagement Type Application Penetration Test
Testing Methodology White Box
Vulnerability Summary
Total High severity issues 2
Total Medium severity issues 6
Total Low severity issues 2
Total vulnerabilities identified 10
See Section 3.1 for descriptions of these classifications.
Category Breakdown:
Authentication 1 ■
Access Controls 0
Auditing and Logging 1 ■
Configuration 3 ■■■
Cryptography 0
Data Exposure 3 ■■■
Data Validation 3 ■■■
Denial of Service 0
Error Reporting 0
Patching 0
Session Management 0
Timing 0
June 2, 2014 Open Technology Fund Version 1.2
iSEC Partners Final Report Mailvelope Page 5 of 28
1.1 iSEC Risk Summary
The iSEC Partners Threat Matrix chart evaluates discovered vulnerabilities according to business
risk. The impact of the vulnerability increases towards the bottom of the chart. The sophistica-
tion 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 business risk.
June 2, 2014 Open Technology Fund Version 1.2
iSEC Partners Final Report Mailvelope Page 6 of 28
1.2 Project Summary
The Open Technology Fund1 (OTF) engaged iSEC Partners to perform a source code assisted
review of the Mailvelope Firefox Add-on starting April 28th. The purpose of the engagement was
to review the latest release of the extension for common vulnerabilities and to offer suggestions
for improvements. The assessment lasted over a two week period during which consultants re-
viewed version 0.8.1 of the release. Most of the engagement was focused on this version, but
during the testing period the 0.8.2 version was released and small portions of its functionality
were reviewed, including the decryption function and the use of DOMPurify. The third party
library, OpenPGP.js, was not reviewed during this assessment.
iSEC identified the plug-in’s threat model, key features, and areas that should be emphasized.
Among those target areas were the encryption/decryption functions, public key import func-
tions, and watch list controls. The HTML5 sandboxing initiatives were reviewed as well as the
communication functions that transferred data from the standard browser environment to the
internal resources of the Mailvelope add-on.
1.3 Findings Summary
The vulnerabilities identified in this report reflect that the “DOMPurify” and “wysiHTML5” fil-
tering libraries for data validation sufficiently minimize the attack surface. However, a signifi-
cant amount of trust is placed in them, which leads iSEC to be nervous about the possibility of
future cross-site scripting attacks. So while these mechanisms minimize the attack surface, iSEC
has made recommendations that provide defense-in-depth in the case that DOMPurify or the
HTML5 sandbox could eventually be evaded.
As discussed below, further validating the source of postMessage events, standardizing the
parseHTML functions used throughout the extension, and considering whitelisting data re-
ceived even from trusted sources makes the extension less reliant on third party libraries, the
cross-origin policy and HTML5 sandbox.
Besides these recommendations, iSEC also identified a few vulnerabilities relating to the loading
of remote resources and parsing top level domain suffixes.
1.4 Recommendations Summary
While remediating individual vulnerabilities is expected, it is also important to take a broad per-
spective to identify root causes of these issues. Based on the vulnerabilities identified in this
report, iSEC believes that the following recommendations are in order:
Short Term
Short term recommendations are meant to be relatively easily executed actions, such as configu-
ration changes or file deletions that resolve security vulnerabilities. These may also include more
difficult actions that should be taken immediately to resolve high risk vulnerabilities. This area
is a summary of short term recommendations, additional recommendations can be found in the
vulnerabilities section.
1 https://www.opentechfund.org
June 2, 2014 Open Technology Fund Version 1.2
iSEC Partners Final Report Mailvelope Page 7 of 28
Perform additional input validation on data coming from the browser environment.
While the extension uses postMessage() communications to send data to and from the HTML5
sandbox and code execution is controlled by a cross-origin policy,