GHSA-89v2-g37m-g3ff: Aws encryption sdk cli Improper Verification Of Cryptographic Signature Vulnerability

MODERATE
CWE-347
Published
Advisory Summary

GHSA-89v2-g37m-g3ff is a MODERATE improper verification of cryptographic signature vulnerability (CWE-347: Improper Verification of Cryptographic Signature) affecting Aws encryption sdk cli libraries in the PyPI ecosystem. The issue involves improper verification of cryptographic signature in aws-encryption-sdk-cli. Remediation is available by upgrading affected packages to version 1.9.0, 2.2.0.

GHSA-89v2-g37m-g3ff at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-89v2-g37m-g3ff
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-347: Improper Verification of Cryptographic Signature
Affected Product Aws encryption sdk cli
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix GHSA-89v2-g37m-g3ff

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

aws-encryption-sdk-cli fixed: 1.9.0
pip install aws-encryption-sdk-cli>=1.9.0
aws-encryption-sdk-cli fixed: 2.2.0
pip install aws-encryption-sdk-cli>=2.2.0
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 aws-encryption-sdk-cli

How to Check if You Are Affected

To determine whether your Python environment is affected by GHSA-89v2-g37m-g3ff, inspect your installed packages using pip:

pip show aws-encryption-sdk-cli

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

Note: The pip show aws-encryption-sdk-cli command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-347: Improper Verification of Cryptographic Signature, where the product does not verify, or incorrectly verifies, the cryptographic signature for data. In Aws encryption sdk cli, 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

### Impact This advisory addresses several LOW severity issues with streaming signed messages and restricting processing of certain types of invalid messages. This ESDK supports a streaming mode where callers may stream the plaintext of signed messages before the ECDSA signature is validated. In addition to these signatures, the ESDK uses AES-GCM encryption and all plaintext is verified before being released to a caller. There is no impact on the integrity of the ciphertext or decrypted plaintext, however some callers may rely on the the ECDSA signature for non-repudiation. Without validating the ECDSA signature, an actor with trusted KMS permissions to decrypt a message may also be able to encrypt messages. This update introduces a new API for callers who wish to stream only unsigned messages. For customers who process ESDK messages from untrusted sources, this update also introduces a new configuration to limit the number of Encrypted Data Keys (EDKs) that the ESDK will attempt to process per message. This configuration provides customers with a way to limit the number of AWS KMS Decrypt API calls that the ESDK will make per message. This setting will reject messages with more EDKs than the configured limit. Finally, this update adds early rejection of invalid messages with certain invalid combinations of algorithm suite and header data. ### Patches Fixed in versions 1.9 and 2.2. We recommend that all users upgrade to address these issues. Customers leveraging the ESDK’s streaming features have several options to protect signature validation. One is to ensure that client code reads to the end of the stream before using released plaintext. With this release, using the new API for streaming and falling back to the non-streaming decrypt API for signed messages prevents using any plaintext from signed data before the signature is validated. See https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/about-versions.html#version2.2.x Users processing ESDK messages from untrusted sources should use the new maximum encrypted data keys parameter. See https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/about-versions.html#version2.2.x ### Workarounds None ### For more information https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#digital-sigs https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/about-versions.html#version2.2.x

GHSA-89v2-g37m-g3ff Affected Aws encryption sdk cli Versions

2 component(s)
Fixed Versions:
1.9.02.2.0
Product / Package Ecosystem Affected Versions Fixed Version
aws-encryption-sdk-cli
PyPI
< 1.9.0
1.9.0
aws-encryption-sdk-cli
PyPI
≥ 2.0.0
< 2.2.0
2.2.0

References

Frequently Asked Questions

What is GHSA-89v2-g37m-g3ff?
GHSA-89v2-g37m-g3ff is a security vulnerability in Aws encryption sdk cli involving Improper Verification of Cryptographic Signature in aws-encryption-sdk-cli under CWE-347: Improper Verification of Cryptographic Signature.
Which Aws encryption sdk cli versions are affected?
Affected versions include releases prior to 1.9.0, 2.2.0 across affected packages: aws-encryption-sdk-cli.
What version fixes GHSA-89v2-g37m-g3ff?
Upgrading to 1.9.0, 2.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is aws-encryption-sdk-cli affected?
Yes, aws-encryption-sdk-cli is affected in releases prior to 1.9.0, 2.2.0. Upgrade your dependency to 1.9.0, 2.2.0 or later.
What CWE is associated with GHSA-89v2-g37m-g3ff?
GHSA-89v2-g37m-g3ff is classified under CWE-347: Improper Verification of Cryptographic Signature (The product does not verify, or incorrectly verifies, the cryptographic signature for data.).
How can I check PyPI dependencies for GHSA-89v2-g37m-g3ff?
Run the dependency tree command: 'pip show aws-encryption-sdk-cli'. 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-89v2-g37m-g3ff",
  "modified" : "2021-06-01T18:53:10Z",
  "published" : "2021-06-01T21:18:53Z",
  "aliases" : [ ],
  "summary" : "Improper Verification of Cryptographic Signature in aws-encryption-sdk-cli",
  "details" : "### Impact\n\nThis advisory addresses several LOW severity issues with streaming signed messages and restricting processing of certain types of invalid messages. \n\nThis ESDK supports a streaming mode where callers may stream the plaintext of signed messages before the ECDSA signature is validated. In addition to these signatures, the ESDK uses AES-GCM encryption and all plaintext is verified before being released to a caller. There is no impact on the integrity of the ciphertext or decrypted plaintext, however some callers may rely on the the ECDSA signature for non-repudiation. Without validating the ECDSA signature, an actor with trusted KMS permissions to decrypt a message may also be able to encrypt messages. This update introduces a new API for callers who wish to stream only unsigned messages. \n\nFor customers who process ESDK messages from untrusted sources, this update also introduces a new configuration to limit the number of Encrypted Data Keys (EDKs) that the ESDK will attempt to process per message. This configuration provides customers with a way to limit the number of AWS KMS Decrypt API calls that the ESDK will make per message. This setting will reject messages with more EDKs than the configured limit.\n\nFinally, this update adds early rejection of invalid messages with certain invalid combinations of algorithm suite and header data.\n\n### Patches\n\nFixed in versions 1.9 and 2.2. We recommend that all users upgrade to address these issues.\n\nCustomers leveraging the ESDK’s streaming features have several options to protect signature validation. One is to ensure that client code reads to the end of the stream before using released plaintext. With this release, using the new API for streaming and falling back to the non-streaming decrypt API for signed messages prevents using any plaintext from signed data before the signature is validated. See https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/about-versions.html#version2.2.x\n\nUsers processing ESDK messages from untrusted sources should use the new maximum encrypted data keys parameter. See https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/about-versions.html#version2.2.x\n\n### Workarounds\n\nNone\n\n### For more information\n\nhttps://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/concepts.html#digital-sigs\n\nhttps://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/about-versions.html#version2.2.x\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "aws-encryption-sdk-cli"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.9.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "aws-encryption-sdk-cli"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/aws/aws-encryption-sdk-cli/security/advisories/GHSA-89v2-g37m-g3ff"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-347" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-06-01T18:53:10Z",
    "nvd_published_at" : null
  }
}