# CVE-2021-40828: TLS hostname validation issues within AWS IoT Device SDKs on Windows

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 6.3
- **CVSS:** 6.3 (v3.1, CNA) `CVSS:3.1/AV:A/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Adjacent network; Attack complexity: High; Privileges required: High; User interaction: Required; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.41% (percentile 27, 2026-11-26)
- **CWE:** CWE-295
- **Aliases:** GHSA-94jq-q5v2-76wj, PYSEC-2021-861
- **Published:** 2021-11-22T23:41:16.000Z
- **Modified:** 2026-06-17T04:07:29.540Z

## Who should check

- Projects that depend on PyPI package awsiotsdk (\< 1.5.18)
- Projects that depend on Maven package software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk (\< 1.3.3)
- Projects that depend on npm package aws-iot-device-sdk-v2 (\< 1.5.1)
- Anyone running Amazon Web Services AWS IoT Device SDK v2 for Java \>= unspecified, \< 1.3.3
- Anyone running Amazon Web Services AWS IoT Device SDK v2 for Python \>= unspecified, \< 1.5.18
- Anyone running Amazon Web Services AWS IoT Device SDK v2 for C++ \>= unspecified, \< 1.12.7
- Anyone running Amazon Web Services AWS IoT Device SDK v2 for Node.js \>= unspecified, \< 1.5.3
- Anyone running Amazon Web Services AWS-C-IO 0.9.12

## Description

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

## Affected and fixed versions

- PyPI `awsiotsdk`: affected \< 1.5.18; fixed 1.5.18 (osv)
- Maven `software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk`: affected \< 1.3.3; fixed 1.3.3 (osv)
- npm `aws-iot-device-sdk-v2`: affected \< 1.5.1; fixed 1.5.1 (osv)
- Amazon Web Services AWS IoT Device SDK v2 for Java: \>= unspecified, \< 1.3.3 (cvelist)
- Amazon Web Services AWS IoT Device SDK v2 for Python: \>= unspecified, \< 1.5.18 (cvelist)
- Amazon Web Services AWS IoT Device SDK v2 for C++: \>= unspecified, \< 1.12.7 (cvelist)
- Amazon Web Services AWS IoT Device SDK v2 for Node.js: \>= unspecified, \< 1.5.3 (cvelist)
- Amazon Web Services AWS-C-IO: 0.9.12 (cvelist)

## Mitigation

- Upgrade awsiotsdk to 1.5.18 or later.
- Upgrade software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk to 1.3.3 or later.
- Upgrade aws-iot-device-sdk-v2 to 1.5.1 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2021-40828. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-40828.md
Affected: awsiotsdk < 1.5.18; software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk < 1.3.3; aws-iot-device-sdk-v2 < 1.5.1
Fixed in: 1.5.18, 1.3.3, 1.5.1

Steps:
1. Search this machine and project for awsiotsdk (PyPI), software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk (Maven), aws-iot-device-sdk-v2 (npm), 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++: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2021-40828 being exploited?

There is no confirmed exploitation: CVE-2021-40828 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.41% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2021-40828?

Medium: CVSS 6.3 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). A user has to take an action, such as opening a link, for the attack to work. The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2021-40828?

awsiotsdk \< 1.5.18; software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk \< 1.3.3; aws-iot-device-sdk-v2 \< 1.5.1.

### Is there a fix for CVE-2021-40828?

Yes. Fixed in 1.5.18, 1.3.3, 1.5.1. Upgrade awsiotsdk to 1.5.18 or later. Upgrade software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk to 1.3.3 or later. Upgrade aws-iot-device-sdk-v2 to 1.5.1 or later.

### How do I check if I'm affected by CVE-2021-40828?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/advisories/GHSA-94jq-q5v2-76wj>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2021-40828>
- patch: <https://github.com/aws/aws-iot-device-sdk-java-v2/commit/67950ad2a02f2f9355c310b69dc9226b017f32f2>
- patch: <https://github.com/aws/aws-iot-device-sdk-js-v2/commit/4be41394f1aee979e6f4b012fcb01eecabd0c08d>
- patch: <https://github.com/aws/aws-iot-device-sdk-python-v2/commit/fd4c0ba04b35eab9e20c635af5548fcc5a92d8be>
- other: <https://github.com/awslabs/aws-c-io/>
- other: <https://github.com/aws/aws-iot-device-sdk-cpp-v2>
- other: <https://github.com/aws/aws-iot-device-sdk-python-v2>
- other: <https://github.com/aws/aws-iot-device-sdk-java-v2>
- other: <https://github.com/aws/aws-iot-device-sdk-js-v2>
- other: <https://github.com/awslabs/aws-c-io>
- other: <https://github.com/pypa/advisory-database/tree/main/vulns/awsiotsdk/PYSEC-2021-861.yaml>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-40828>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/PYSEC-2021-861> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-94jq-q5v2-76wj> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2021-40828> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-40828>
