Vulnerabilities in pkg:npm/@aws-crypto/client-browser

PACKAGE
Advisory Summary

GHSA-h45p-w933-jxh3 is a MODERATE improper verification of cryptographic signature vulnerability (CWE-347: Improper Verification of Cryptographic Signature) affecting @aws crypto/client browser libraries in the npm ecosystem. The issue involves improper verification of cryptographic signature in aws-encryption-sdk-javascript. Remediation is available by upgrading affected packages to version 1.9.0, 2.2.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@aws-crypto/client-browser

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@aws-crypto/client-browser. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-h45p-w933-jxh3 - MODERATE Improper Verification of Cryptographic Signature in aws-encryption-sdk-javascript

GHSA-h45p-w933-jxh3 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-h45p-w933-jxh3
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-347: Improper Verification of Cryptographic Signature
Affected Product @aws crypto/client browser
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-h45p-w933-jxh3

To remediate this vulnerability, upgrade all affected @aws crypto/client browser 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-crypto/client-browser fixed: 1.9.0
npm install @aws-crypto/client-browser@1.9.0
@aws-crypto/client-browser fixed: 2.2.0
npm install @aws-crypto/client-browser@2.2.0
@aws-crypto/client-node fixed: 1.9.0
npm install @aws-crypto/client-node@1.9.0
@aws-crypto/client-node fixed: 2.2.0
npm install @aws-crypto/client-node@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:

npm ls @aws-crypto/client-browser

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-h45p-w933-jxh3, inspect your project dependencies using npm:

npm ls @aws-crypto/client-browser

Analyze the terminal output to locate any version of @aws crypto/client browser 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 npm ls @aws-crypto/client-browser command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

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 crypto/client browser, 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-h45p-w933-jxh3 Affected @aws crypto/client browser Versions

4 component(s)
Fixed Versions:
1.9.02.2.0
Product / Package Ecosystem Affected Versions Fixed Version
@aws-crypto/client-browser
npm
< 1.9.0
1.9.0
@aws-crypto/client-browser
npm
≥ 2.0.0
< 2.2.0
2.2.0
@aws-crypto/client-node
npm
< 1.9.0
1.9.0
@aws-crypto/client-node
npm
≥ 2.0.0
< 2.2.0
2.2.0

References

Frequently Asked Questions

What is GHSA-h45p-w933-jxh3?
GHSA-h45p-w933-jxh3 is a security vulnerability in @aws crypto/client browser involving Improper Verification of Cryptographic Signature in aws-encryption-sdk-javascript under CWE-347: Improper Verification of Cryptographic Signature.
Which @aws crypto/client browser versions are affected?
Affected versions include releases prior to 1.9.0, 2.2.0 across affected packages: @aws-crypto/client-browser, @aws-crypto/client-node.
What version fixes GHSA-h45p-w933-jxh3?
Upgrading to 1.9.0, 2.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @aws-crypto/client-browser affected?
Yes, @aws-crypto/client-browser is affected in releases prior to 1.9.0, 2.2.0. Upgrade your dependency to 1.9.0, 2.2.0 or later.
Is @aws-crypto/client-node affected?
Yes, @aws-crypto/client-node 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-h45p-w933-jxh3?
GHSA-h45p-w933-jxh3 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 npm dependencies for GHSA-h45p-w933-jxh3?
Run the dependency tree command: 'npm ls @aws-crypto/client-browser'. 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-h45p-w933-jxh3",
  "modified" : "2021-06-01T18:59:14Z",
  "published" : "2021-06-01T21:20:22Z",
  "aliases" : [ ],
  "summary" : "Improper Verification of Cryptographic Signature in aws-encryption-sdk-javascript ",
  "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" : "npm",
      "name" : "@aws-crypto/client-browser"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.9.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@aws-crypto/client-browser"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.2.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@aws-crypto/client-node"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.9.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@aws-crypto/client-node"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/aws/aws-encryption-sdk-javascript/security/advisories/GHSA-h45p-w933-jxh3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-347" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-06-01T18:59:14Z",
    "nvd_published_at" : null
  }
}