CVE-2016-9243: Cryptography Improper Input Validation Vulnerability

HIGH
Advisory Identifier: GHSA-q3cj-2r34-2cwc
CVSS 7.5
CWE-20
Published
Advisory Summary

CVE-2016-9243 is a HIGH (CVSS 7.5) improper input validation vulnerability (CWE-20: Improper Input Validation) affecting Cryptography libraries in the PyPI ecosystem. The issue involves improper input validation in cryptography. Remediation is available by upgrading affected packages to version 1.5.3.

CVE-2016-9243 at a Glance

CVE Identifier CVE-2016-9243
GHSA Identifier GHSA-q3cj-2r34-2cwc
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-20: Improper Input Validation
Affected Product Cryptography
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2016-9243

To remediate this vulnerability, upgrade all affected Cryptography dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

cryptography fixed: 1.5.3
pip install cryptography>=1.5.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show cryptography

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2016-9243, inspect your installed packages using pip:

pip show cryptography

Analyze the terminal output to locate any version of Cryptography in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.5.3), your application is affected.

Note: The pip show cryptography command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Cryptography, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

HKDF in cryptography before 1.5.3 returns an empty byte-string if used with a length less than algorithm.digest_size.

CVE-2016-9243 Affected Cryptography Versions

1 component(s)
Fixed Versions:
1.5.3
Product / Package Ecosystem Affected Versions Fixed Version
cryptography
PyPI
< 1.5.3
1.5.3

References

NVD — CVE-2016-9243 NVD
https://nvd.nist.gov/vuln/detail/CVE-2016-9243
Cryptography Source Repository REPOSITORY
https://github.com/pyca/cryptography/issues/3211
Security Fix Commit FIX COMMIT
https://github.com/pyca/cryptography/commit/b924696b2e8731f39696584d12cceeb3aeb2d874
Cryptography Security Information SECURITY
https://cryptography.io/en/latest/changelog
Cryptography Security Information SECURITY
https://cryptography.io/en/latest/changelog/#v1-5-3
GitHub Advisory / Wiki ADVISORY
https://github.com/advisories/GHSA-q3cj-2r34-2cwc
Cryptography Source Repository REPOSITORY
https://github.com/pyca/cryptography
Cryptography Source Repository REPOSITORY
https://github.com/pypa/advisory-database/tree/main/vulns/cryptography/PYSEC-2017-8.yaml
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/5R2ZOBMPWDFFHUZ6QOZZY36A6H5CGJXL
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/U23KDR2M2N7W2ZSREG63BVW7D4VC6CIZ
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WQ5G7KHKZC4SI23JE7277KZXM57GEQKT
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/5R2ZOBMPWDFFHUZ6QOZZY36A6H5CGJXL
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/U23KDR2M2N7W2ZSREG63BVW7D4VC6CIZ
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/WQ5G7KHKZC4SI23JE7277KZXM57GEQKT
Cryptography Security Information SECURITY
http://www.openwall.com/lists/oss-security/2016/11/09/2
Cryptography Security Information SECURITY
http://www.securityfocus.com/bid/94216
www.ubuntu.com/usn/usn-3138-1 WEB
http://www.ubuntu.com/usn/USN-3138-1

Frequently Asked Questions

What is CVE-2016-9243?
CVE-2016-9243 is a security vulnerability in Cryptography involving Improper input validation in cryptography under CWE-20: Improper Input Validation.
Which Cryptography versions are affected?
Affected versions include releases prior to 1.5.3 across affected packages: cryptography.
What version fixes CVE-2016-9243?
Upgrading to 1.5.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is cryptography affected?
Yes, cryptography is affected in releases prior to 1.5.3. Upgrade your dependency to 1.5.3 or later.
What is the CVSS score of CVE-2016-9243?
CVE-2016-9243 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2016-9243?
CVE-2016-9243 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check PyPI dependencies for CVE-2016-9243?
Run the dependency tree command: 'pip show cryptography'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-q3cj-2r34-2cwc",
  "modified" : "2024-09-13T20:08:25Z",
  "published" : "2022-05-17T02:51:56Z",
  "aliases" : [ "CVE-2016-9243" ],
  "summary" : "Improper input validation in cryptography",
  "details" : "HKDF in cryptography before 1.5.3 returns an empty byte-string if used with a length less than algorithm.digest_size.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "cryptography"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.5.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-9243"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pyca/cryptography/issues/3211"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pyca/cryptography/commit/b924696b2e8731f39696584d12cceeb3aeb2d874"
  }, {
    "type" : "WEB",
    "url" : "https://cryptography.io/en/latest/changelog"
  }, {
    "type" : "WEB",
    "url" : "https://cryptography.io/en/latest/changelog/#v1-5-3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-q3cj-2r34-2cwc"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pyca/cryptography"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/cryptography/PYSEC-2017-8.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/5R2ZOBMPWDFFHUZ6QOZZY36A6H5CGJXL"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/U23KDR2M2N7W2ZSREG63BVW7D4VC6CIZ"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WQ5G7KHKZC4SI23JE7277KZXM57GEQKT"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/5R2ZOBMPWDFFHUZ6QOZZY36A6H5CGJXL"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/U23KDR2M2N7W2ZSREG63BVW7D4VC6CIZ"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/WQ5G7KHKZC4SI23JE7277KZXM57GEQKT"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2016/11/09/2"
  }, {
    "type" : "WEB",
    "url" : "http://www.securityfocus.com/bid/94216"
  }, {
    "type" : "WEB",
    "url" : "http://www.ubuntu.com/usn/USN-3138-1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-17T21:29:04Z",
    "nvd_published_at" : "2017-03-27T17:59:00Z"
  }
}