# What is CVE-2021-40831?

> CVE-2021-40831 is a high-severity flaw (CVSS 7.2) in Amazon Web Services Aws-C-Io, published on 23 November 2021. It is not on the list of flaws known to be exploited today. The latest forecast puts its chance of use in the next 30 days at 0.6%. If you run an affected version, plan in the vendor’s fix.

Canonical page: https://www.edgeprotect.io/what-is/cve-2021-40831

## At a glance

- **Verdict:** Plan it in. No sign of exploitation and a low forecast. Patch it in your normal update cycle.
- **EdgeProtect risk score:** 46 out of 100 (Medium); action: Plan remediation. Kept up to date as the evidence changes.
- **Severity:** High (CVSS 7.2 out of 10)
- **Known to be exploited:** No, not on the list of flaws known to be exploited today
- **Chance of use in the next 30 days:** 0.6% (latest exploit-likelihood forecast)
- **Published:** 23 November 2021
- **Record last updated:** 2 December 2021
- **Main product:** Amazon Web Services Aws-C-Io
- **Affected products:** 3

## What is CVE-2021-40831? In plain terms

It can be attacked from anywhere on the internet with an administrator account, and nobody has to click anything. If it works, the attacker can read data, change data and take it offline.

### The official 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 macOS systems. Additionally, SNI validation is also not enabled when the CA has been “overridden”. 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 address this behavior. This issue affects: Amazon Web Services AWS IoT Device SDK v2 for Java versions prior to 1.5.0 on macOS. Amazon Web Services AWS IoT Device SDK v2 for Python versions prior to 1.7.0 on macOS. Amazon Web Services AWS IoT Device SDK v2 for C++ versions prior to 1.14.0 on macOS. Amazon Web Services AWS IoT Device SDK v2 for Node.js versions prior to 1.6.0 on macOS. Amazon Web Services AWS-C-IO 0.10.7 on macOS.

### What kind of flaw is it?

- CWE-295: Improper Certificate Validation

### How an attack on it works

- Where an attacker can be: Anywhere on the internet
- How hard it is to pull off: Easy: no special conditions
- Login needed first: An administrator account
- Does someone have to click: No, nobody has to do anything
- What an attacker gets: Can read data, change data and take it offline

Severity vector: `CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H`

## Is CVE-2021-40831 being exploited? Not that we know of

It is not on the list of flaws known to be exploited today. The latest forecast puts the chance of it being used in the next 30 days at 0.6%. That can change at any time, which is why we keep watching.

Exploit likelihood over the last 7 days: 0.6%, 0.6%, 0.6%, 0.6%, 0.6%, 0.6%, 0.6%.

### Timeline

- 23 November 2021: Published
- 2 December 2021: Record last updated

### How EdgeProtect ranks it

CVE-2021-40831 scores **46 out of 100 (Medium)**, with the action "Plan remediation".

Every published flaw gets a risk score from 0 to 100, kept up to date as the evidence changes. Four things go into the score, from the one that counts most to the ones that count less:

- Evidence it is being exploited: biggest factor
- How severe it is: strong factor
- How widely exposed it is: key context
- Real threat activity around it: key context

85 and above is Critical. Anything confirmed as exploited is always marked for an emergency patch, whatever its score. When this flaw matches software you track, it lands in your list with its score and the reasons behind it.

## Who is affected by CVE-2021-40831?

The published record lists 3 products. Versions are as published: "before 1.5.0" means every version up to, but not including, 1.5.0.

- [Amazon Web Services Aws-C-Io](https://www.edgeprotect.io/product/amazon/amazon_web_services_aws-c-io) by [Amazon](https://www.edgeprotect.io/vendors/amazon) (Application): 0.10.7
- [Amazon Web Services Internet of Things Device Software Development Kit V2](https://www.edgeprotect.io/product/amazon/amazon_web_services_internet_of_things_device_software_development_kit_v2) by [Amazon](https://www.edgeprotect.io/vendors/amazon) (Application): before 1.5.0, before 1.6.0, before 1.7.0, before 1.14.0
- [macOS](https://www.edgeprotect.io/product/apple/macos) by [Apple](https://www.edgeprotect.io/vendors/apple) (Operating system): version not specified

## How do I fix CVE-2021-40831?

1. **Check whether you run it.** Compare your versions with the affected products above. Not sure what you run? EdgeProtect can work it out from your public website, or you can pick it from a list.
2. **Apply the vendor’s fix.** Install the latest update from the vendor. The references list where the vendor has published details.
3. **If you can’t patch today.** Follow any mitigation the vendor publishes, and limit who can reach the affected system from the internet until the update is in.
4. **Keep an eye on it.** Track the product and we tell you as soon as we spot this flaw on the list of exploited flaws, or a jump in its exploit likelihood.

### References

- [github.com](https://github.com/aws/aws-iot-device-sdk-cpp-v2) (Product)
- [github.com](https://github.com/aws/aws-iot-device-sdk-java-v2) (Product)
- [github.com](https://github.com/aws/aws-iot-device-sdk-js-v2) (Product)
- [github.com](https://github.com/aws/aws-iot-device-sdk-python-v2) (Product)
- [github.com](https://github.com/awslabs/aws-c-io/) (Product)

## Questions

### What is CVE-2021-40831?

CVE-2021-40831 is a high-severity flaw in Amazon Web Services Aws-C-Io, published on 23 November 2021. It can be attacked from anywhere on the internet with an administrator account, and nobody has to click anything. If it works, the attacker can read data, change data and take it offline.

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

It scores 7.2 out of 10 on the CVSS severity scale, which is high. Our risk score for CVE-2021-40831 is 46 out of 100, which is Medium. Its action is "Plan remediation". No sign of exploitation and a low forecast. Patch it in your normal update cycle.

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

It is not on the list of flaws known to be exploited today. The latest forecast puts the chance of it being used in the next 30 days at 0.6%. That can change at any time, which is why we keep watching.

### Which versions does CVE-2021-40831 affect?

For Amazon Web Services Aws-C-Io: 0.10.7. The record lists 3 products in all, each with its versions, under "Who is affected" on this page.

### How do I fix CVE-2021-40831?

Install the update the vendor names in its advisory. If you can't patch today, follow the vendor's mitigation and limit who can reach the affected system from the internet.

## Does CVE-2021-40831 affect you?

EdgeProtect keeps checking for you:

- **Tell us what you run.** Pick your software from a list, or let us work it out from your website.
- **We match it to every flaw.** Over 400,000 published flaws, checked against your list.
- **Ranked by real-world risk.** Every flaw gets a 0 to 100 risk score, kept up to date, led by evidence criminals are using it.
- **Told as soon as we know.** An alert by email, in the app or by webhook to your own tools.

Start free (no card, nothing to install): https://www.edgeprotect.io/register
Book a demo: https://www.edgeprotect.io/contact

