blob: 251d2d95192660f826667acd276c0731c6c30413 [file] [log] [blame]
Alex Gaynor99b69d92013-10-19 17:52:58 -07001Security
2========
3
Ayrxffd8d432014-06-05 17:11:59 +08004We take the security of ``cryptography`` seriously. The following are a set of
5policies we have adopted to ensure that security issues are addressed in a
6timely fashion.
7
Alex Gaynor13e9a6f2017-08-23 16:46:55 -04008Infrastructure
9--------------
10
11In addition to ``cryptography``'s code, we're also concerned with the security
12of the infrastructure we run (primarily ``cryptography.io`` and
13``ci.cryptography.io``). If you discover a security vulnerability in our
14infrastructure, we ask you to report it using the same procedure.
15
Alex Gaynor940c92f2016-02-19 06:34:39 -050016What is a security issue?
17-------------------------
18
19Anytime it's possible to write code using ``cryptography``'s public API which
Alex Gaynorebcd0372016-02-19 07:06:54 -050020does not provide the guarantees that a reasonable developer would expect it to
Alex Gaynor940c92f2016-02-19 06:34:39 -050021based on our documentation.
22
23That's a bit academic, but basically it means the scope of what we consider a
24vulnerability is broad, and we do not require a proof of concept or even a
25specific exploit, merely a reasonable threat model under which ``cryptography``
26could be attacked.
27
28To give a few examples of things we would consider security issues:
29
30* If a recipe, such as Fernet, made it easy for a user to bypass
31 confidentiality or integrity with the public API (e.g. if the API let a user
32 reuse nonces).
33* If, under any circumstances, we used a CSPRNG which wasn't fork-safe.
34* If ``cryptography`` used an API in an underlying C library and failed to
35 handle error conditions safely.
36
37Examples of things we wouldn't consider security issues:
38
Alex Gaynorf7721aa2016-02-19 07:11:03 -050039* Offering ECB mode for symmetric encryption in the *Hazmat* layer. Though ECB
40 is critically weak, it is documented as being weak in our documentation.
Alex Gaynor940c92f2016-02-19 06:34:39 -050041* Using a variable time comparison somewhere, if it's not possible to
42 articulate any particular program in which this would result in problematic
43 information disclosure.
44
45In general, if you're unsure, we request that you to default to treating things
46as security issues and handling them sensitively, the worst thing that can
Alex Gaynor9ef1d6f2017-03-24 21:03:15 -040047happen is that we'll ask you to file a public issue.
Alex Gaynor940c92f2016-02-19 06:34:39 -050048
Ayrxffd8d432014-06-05 17:11:59 +080049Reporting a security issue
50--------------------------
51
52We ask that you do not report security issues to our normal GitHub issue
53tracker.
54
55If you believe you've identified a security issue with ``cryptography``, please
Alex Gaynor09dd2872014-10-22 14:15:43 -070056report it to ``alex.gaynor@gmail.com``. Messages may be optionally encrypted
57with PGP using key fingerprint
Alex Gaynor940c92f2016-02-19 06:34:39 -050058``F7FC 698F AAE2 D2EF BECD E98E D1B3 ADC0 E023 8CA6`` (this public key is
Alex Gaynor09dd2872014-10-22 14:15:43 -070059available from most commonly-used key servers).
Alex Gaynor99b69d92013-10-19 17:52:58 -070060
Alex Gaynor9cd4b212014-01-10 06:54:21 -080061Once you've submitted an issue via email, you should receive an acknowledgment
Alex Gaynor99b69d92013-10-19 17:52:58 -070062within 48 hours, and depending on the action to be taken, you may receive
Alex Gaynor59075df2014-01-10 11:40:03 -080063further follow-up emails.
Ayrxffd8d432014-06-05 17:11:59 +080064
65Supported Versions
66------------------
67
68At any given time, we will provide security support for the `master`_ branch
Alex Gaynor940c92f2016-02-19 06:34:39 -050069as well as the most recent release.
Ayrxffd8d432014-06-05 17:11:59 +080070
Terry Chia81fed662014-07-07 11:25:51 +080071New releases for OpenSSL updates
72--------------------------------
73
Alex Gaynor56669aa2017-10-04 21:25:55 -040074As of versions 0.5, 1.0.1, and 2.0.0, ``cryptography`` statically links OpenSSL
75on Windows, macOS, and Linux respectively, to ease installation. Due to this,
76``cryptography`` will release a new version whenever OpenSSL has a security or
77bug fix release to avoid shipping insecure software.
Terry Chia81fed662014-07-07 11:25:51 +080078
79Like all our other releases, this will be announced on the mailing list and we
80strongly recommend that you upgrade as soon as possible.
81
Ayrxffd8d432014-06-05 17:11:59 +080082Disclosure Process
83------------------
84
85Our process for taking a security issue from private discussion to public
86disclosure involves multiple steps.
87
88Approximately one week before full public disclosure, we will send advance
89notification of the issue to a list of people and organizations, primarily
90composed of operating-system vendors and other distributors of
Ayrxead04a42014-06-06 00:59:18 +080091``cryptography``. This notification will consist of an email message
92containing:
Ayrxffd8d432014-06-05 17:11:59 +080093
94* A full description of the issue and the affected versions of
95 ``cryptography``.
96* The steps we will be taking to remedy the issue.
Ayrx189f1702014-06-05 18:16:36 +080097* The patches, if any, that will be applied to ``cryptography``.
Ayrxffd8d432014-06-05 17:11:59 +080098* The date on which the ``cryptography`` team will apply these patches, issue
Alex Gaynore2f523a2014-06-05 13:09:47 -070099 new releases, and publicly disclose the issue.
Ayrxffd8d432014-06-05 17:11:59 +0800100
101Simultaneously, the reporter of the issue will receive notification of the date
102on which we plan to take the issue public.
103
104On the day of disclosure, we will take the following steps:
105
Ayrx189f1702014-06-05 18:16:36 +0800106* Apply the relevant patches to the ``cryptography`` repository. The commit
Ayrxffd8d432014-06-05 17:11:59 +0800107 messages for these patches will indicate that they are for security issues,
108 but will not describe the issue in any detail; instead, they will warn of
109 upcoming disclosure.
Ayrx189f1702014-06-05 18:16:36 +0800110* Issue the relevant releases.
Ayrxffd8d432014-06-05 17:11:59 +0800111* Post a notice to the cryptography mailing list that describes the issue in
112 detail, point to the new release and crediting the reporter of the issue.
113
114If a reported issue is believed to be particularly time-sensitive due to a
115known exploit in the wild, for example the time between advance notification
116and public disclosure may be shortened considerably.
117
118The list of people and organizations who receives advanced notification of
119security issues is not and will not be made public. This list generally
Alex Gaynor8aa893b2017-02-18 01:26:06 -0500120consists of high-profile downstream distributors and is entirely at the
Ayrxffd8d432014-06-05 17:11:59 +0800121discretion of the ``cryptography`` team.
122
123.. _`master`: https://github.com/pyca/cryptography