CVE-2021-40830
Inconsistent CA override function behavior within AWS IoT Device SDKs on Unix systems
Also known as GHSA-c4rh-4376-gff4, PYSEC-2021-863
Mitigation
- Upgrade awsiotsdk to 1.6.1 or later.
- Upgrade software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk to 1.5.0 or later.
- Upgrade aws-iot-device-sdk-v2 to 1.5.3 or later.
Who should check
- Projects that depend on PyPI package awsiotsdk (< 1.6.1)
- Projects that depend on Maven package software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk (< 1.5.0)
- Projects that depend on npm package aws-iot-device-sdk-v2 (< 1.5.3)
- Anyone running Amazon Web Services AWS IoT Device SDK v2 for Java >= unspecified, < 1.5.0
- Anyone running Amazon Web Services AWS IoT Device SDK v2 for Python >= unspecified, < 1.6.1
- 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.10.4
Vulnerability facts
- Affected
- awsiotsdk < 1.6.1; software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk < 1.5.0; aws-iot-device-sdk-v2 < 1.5.3
- Fixed in
- 1.6.1, 1.5.0, 1.5.3
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Not remotely exploitable (local or adjacent access needed)
- CVSS
- 6.3 (v3.1, CNA)CVSS:3.1/AV:A/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 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
- EPSS
- 0.39% chance of exploitation in 30 days (percentile 25, 2026-11-26)
- CWE
- CWE-295
- Modified
Description
The AWS IoT Device SDK v2 for Java, Python, C++ and Node.js appends a user supplied Certificate Authority (CA) to the root CAs instead of overriding it on Unix systems. TLS handshakes will thus succeed if the peer can be verified either from the user-supplied CA or the system’s default trust-store. Attackers with access to a host’s trust stores or are able to compromise a certificate authority already in the host's trust store (note: the attacker must also be able to spoof DNS in this case) may be able to use this issue to bypass CA pinning. An attacker could then spoof the MQTT broker, and either drop traffic and/or respond with the attacker's data, but they would not be able to forward this data on to the MQTT broker because the attacker would still need the user's private keys to authenticate against the MQTT broker. The 'aws_tls_ctx_options_override_default_trust_store_*' function within the aws-c-io submodule has been updated to override the default trust store. This corrects this issue. This issue affects: Amazon Web Services AWS IoT Device SDK v2 for Java versions prior to 1.5.0 on Linux/Unix. Amazon Web Services AWS IoT Device SDK v2 for Python versions prior to 1.6.1 on Linux/Unix. Amazon Web Services AWS IoT Device SDK v2 for C++ versions prior to 1.12.7 on Linux/Unix. Amazon Web Services AWS IoT Device SDK v2 for Node.js versions prior to 1.5.3 on Linux/Unix. Amazon Web Services AWS-C-IO 0.10.4 on Linux/Unix.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| PyPI awsiotsdk | < 1.6.1 | 1.6.1 | osv |
| Maven software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk | < 1.5.0 | 1.5.0 | osv |
| npm aws-iot-device-sdk-v2 | < 1.5.3 | 1.5.3 | osv |
| Amazon Web Services AWS IoT Device SDK v2 for Java | >= unspecified, < 1.5.0 | — | cvelist |
| Amazon Web Services AWS IoT Device SDK v2 for Python | >= unspecified, < 1.6.1 | — | 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.10.4 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2021-40830. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2021-40830.md Affected: awsiotsdk < 1.6.1; software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk < 1.5.0; aws-iot-device-sdk-v2 < 1.5.3 Fixed in: 1.6.1, 1.5.0, 1.5.3 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.
References
Vendor advisories
Patches
Other
- 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
- https://github.com/awslabs/aws-c-io
- https://github.com/pypa/advisory-database/tree/main/vulns/awsiotsdk/PYSEC-2021-863.yaml
FAQ
Is CVE-2021-40830 being exploited?
There is no confirmed exploitation: CVE-2021-40830 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.39% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2021-40830?
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-40830?
awsiotsdk < 1.6.1; software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk < 1.5.0; aws-iot-device-sdk-v2 < 1.5.3.
Is there a fix for CVE-2021-40830?
Yes. Fixed in 1.6.1, 1.5.0, 1.5.3. Upgrade awsiotsdk to 1.6.1 or later. Upgrade software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk to 1.5.0 or later. Upgrade aws-iot-device-sdk-v2 to 1.5.3 or later.
How do I check if I'm affected by CVE-2021-40830?
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.