Vulnerabilities in pkg:npm/aws-iot-device-sdk-v2

PACKAGE
Advisory Identifier: GHSA-743r-5g92-5vgf
Advisory Summary

CVE-2021-40829 is a HIGH (CVSS 6.3) improper certificate management vulnerability (CWE-295: Improper Certificate Validation) affecting Aws iot device sdk libraries in the Maven ecosystem. The issue involves improper certificate management in aws iot device sdk v2. Remediation is available by upgrading affected packages to version 1.4.2, 1.5.3, 1.6.1.

4 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/aws-iot-device-sdk-v2

4 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/aws-iot-device-sdk-v2. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-743r-5g92-5vgf CVE-2021-40829 HIGH Improper certificate management in AWS IoT Device SDK v2
GHSA-c4rh-4376-gff4 CVE-2021-40830 HIGH Improper certificate management in AWS IoT Device SDK v2
GHSA-j3f7-7rmc-6wqj CVE-2021-40831 HIGH Improper certificate management in AWS IoT Device SDK v2
GHSA-94jq-q5v2-76wj CVE-2021-40828 MODERATE Improper certificate management in AWS IoT Device SDK v2

CVE-2021-40829 at a Glance

CVE Identifier CVE-2021-40829
GHSA Identifier GHSA-743r-5g92-5vgf
Severity HIGH
CVSS v3.1 Base Score 6.3
CWE Classification CWE-295: Improper Certificate Validation
Affected Product Aws iot device sdk
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 6.3

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

Attack Vector Adjacent (AV:A)
Attack Complexity High (AC:H)
Privileges Required High (PR:H)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2021-40829

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

software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk fixed: 1.4.2
<dependency>
    <groupId>software.amazon.awssdk.iotdevicesdk</groupId>
    <artifactId>aws-iot-device-sdk</artifactId>
    <version>1.4.2</version>
</dependency>
aws-iot-device-sdk-v2 fixed: 1.5.3
npm install aws-iot-device-sdk-v2@1.5.3
awsiotsdk fixed: 1.6.1
pip install awsiotsdk>=1.6.1
Verify Direct and Transitive Dependencies

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

mvn dependency:tree -Dincludes=software.amazon.awssdk.iotdevicesdk

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2021-40829, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=software.amazon.awssdk.iotdevicesdk

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

Note: The mvn dependency:tree -Dincludes=software.amazon.awssdk.iotdevicesdk command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-295: Improper Certificate Validation, where the product does not validate, or incorrectly validates, a certificate. In Aws iot device sdk, 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

Connections initialized by the AWS IoT Device SDK v2 for Java (versions prior to 1.4.2), Python (versions prior to 1.6.1), C++ (versions prior to 1.12.7) and Node.js (versions prior to 1.5.3) did not verify server certificate hostname during TLS handshake when overriding Certificate Authorities (CA) in their trust stores on MacOS. This issue has been addressed in aws-c-io submodule versions 0.10.5 onward. This issue affects: Amazon Web Services AWS IoT Device SDK v2 for Java versions prior to 1.4.2 on macOS. Amazon Web Services AWS IoT Device SDK v2 for Python versions prior to 1.6.1 on macOS. Amazon Web Services AWS IoT Device SDK v2 for C++ versions prior to 1.12.7 on macOS. Amazon Web Services AWS IoT Device SDK v2 for Node.js versions prior to 1.5.3 on macOS. Amazon Web Services AWS-C-IO 0.10.4 on macOS.

CVE-2021-40829 Affected Aws iot device sdk Versions

3 component(s)
Fixed Versions:
1.4.21.5.31.6.1
Product / Package Ecosystem Affected Versions Fixed Version
software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk
Maven
< 1.4.2
1.4.2
aws-iot-device-sdk-v2
npm
< 1.5.3
1.5.3
awsiotsdk
PyPI
< 1.6.1
1.6.1

References

Frequently Asked Questions

What is CVE-2021-40829?
CVE-2021-40829 is a security vulnerability in Aws iot device sdk involving Improper certificate management in AWS IoT Device SDK v2 under CWE-295: Improper Certificate Validation.
Which Aws iot device sdk versions are affected?
Affected versions include releases prior to 1.4.2, 1.5.3, 1.6.1 across affected packages: software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk, aws-iot-device-sdk-v2, awsiotsdk.
What version fixes CVE-2021-40829?
Upgrading to 1.4.2, 1.5.3, 1.6.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is aws-iot-device-sdk affected?
Yes, software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk is affected in releases prior to 1.4.2. Upgrade your dependency to 1.4.2 or later.
Is aws-iot-device-sdk-v2 affected?
Yes, aws-iot-device-sdk-v2 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-2021-40829?
CVE-2021-40829 has a CVSS v3.1 base score of 6.3 (HIGH) with vector string CVSS:3.1/AV:A/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2021-40829?
CVE-2021-40829 is classified under CWE-295: Improper Certificate Validation (The product does not validate, or incorrectly validates, a certificate.).
How can I check Maven dependencies for CVE-2021-40829?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=software.amazon.awssdk.iotdevicesdk'. 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-743r-5g92-5vgf",
  "modified" : "2024-11-18T16:26:17Z",
  "published" : "2021-11-24T21:11:16Z",
  "aliases" : [ "CVE-2021-40829" ],
  "summary" : "Improper certificate management in AWS IoT Device SDK v2",
  "details" : "Connections initialized by the AWS IoT Device SDK v2 for Java (versions prior to 1.4.2), Python (versions prior to 1.6.1), C++ (versions prior to 1.12.7) and Node.js (versions prior to 1.5.3) did not verify server certificate hostname during TLS handshake when overriding Certificate Authorities (CA) in their trust stores on MacOS. This issue has been addressed in aws-c-io submodule versions 0.10.5 onward. This issue affects: Amazon Web Services AWS IoT Device SDK v2 for Java versions prior to 1.4.2 on macOS. Amazon Web Services AWS IoT Device SDK v2 for Python versions prior to 1.6.1 on macOS. Amazon Web Services AWS IoT Device SDK v2 for C++ versions prior to 1.12.7 on macOS. Amazon Web Services AWS IoT Device SDK v2 for Node.js versions prior to 1.5.3 on macOS. Amazon Web Services AWS-C-IO 0.10.4 on macOS.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:A/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.4.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "aws-iot-device-sdk-v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.5.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "awsiotsdk"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.6.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-40829"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-743r-5g92-5vgf"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aws/aws-iot-device-sdk-cpp-v2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aws/aws-iot-device-sdk-java-v2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aws/aws-iot-device-sdk-java-v2/commits/v1.4.2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aws/aws-iot-device-sdk-js-v2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aws/aws-iot-device-sdk-python-v2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/awslabs/aws-c-io"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/awsiotsdk/PYSEC-2021-862.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-295" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-11-24T20:31:36Z",
    "nvd_published_at" : "2021-11-23T00:15:00Z"
  }
}