{"answers":{"affected":"7 open source packages ship an affected version, including software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk, awsiotsdk and aws-iot-device-sdk-v2. It affects 1 product.","exploited":"There is no known exploitation of CVE-2021-40829 in the wild and no public exploit code.","fix":"Upgrade software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk to 1.4.2 or later.","what":"CVE-2021-40829 is a medium-severity vulnerability in Amazon Web Services AWS IoT Device SDK v2 for C++, published on 22 Nov 2021. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2021-40829 and fix it if it is affected.\n\nWhat it is: CVE-2021-40829 is a medium-severity vulnerability in Amazon Web Services AWS IoT Device SDK v2 for C++, published on 22 Nov 2021. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2021-40829 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk (Maven): affected all versions; fixed in 1.4.2\n- software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk (Maven): affected all versions; fixed in 1.4.2\n- awsiotsdk (PyPI): affected all versions; fixed in 1.6.1\n- awsiotsdk (PyPI): affected all versions; fixed in 1.6.1\n- awsiotsdk (PyPI): affected all versions; fixed in 1.6.1\n- aws-iot-device-sdk-v2 (npm): affected all versions; fixed in 1.5.3\n- aws-iot-device-sdk-v2 (npm): affected all versions; fixed in 1.5.3\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2021-40829/ (Markdown: https://insights.sbomify.com/CVE-2021-40829/index.md)","id":"CVE-2021-40829","markdown":"https://insights.sbomify.com/CVE-2021-40829/index.md","name":"CVE-2021-40829","record":{"aliases":["GHSA-743r-5g92-5vgf","PYSEC-2021-862"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["security_bypass"],"network_reachable":"adjacent_or_local","non_default_config":true,"product_category":"AWS IoT Device SDK","requires_auth":"high_privilege","summary":"AWS IoT Device SDKs on macOS fail to validate TLS hostnames when custom CAs are used, allowing man-in-the-middle attacks.","user_interaction":"required","vuln_class":"security_feature_bypass"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"F-SecureUS","cpe":[{"product":"amazon_web_services_internet_of_things_device_software_development_kit_v2","vendor":"amazon"}],"cvss":{"score":6.3,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:A/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-295","name":"Improper Certificate Validation"}],"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.","ecosystems":["Maven","PyPI","npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"TLS hostname validation issues within AWS IoT Device SDKs on macOS","id":"CVE-2021-40829","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Maven","product":null,"products":[],"type":"security_feature_bypass","year":"2021"},"n_packages":7,"n_references":5,"next":{"headline":"Inconsistent CA override function behavior within AWS IoT Device SDKs on Unix systems","id":"CVE-2021-40830"},"packages":[{"ecosystem":"Maven","fixed":["1.4.2"],"introduced":["0"],"last_affected":[],"package":"software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk","purl":null,"source":"GHSA-743r-5g92-5vgf"},{"ecosystem":"Maven","fixed":["1.4.2"],"introduced":["0"],"last_affected":[],"package":"software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk","purl":"pkg:maven/software.amazon.awssdk.iotdevicesdk/aws-iot-device-sdk","source":"GHSA-743r-5g92-5vgf"},{"ecosystem":"PyPI","fixed":["1.6.1"],"introduced":["0"],"last_affected":[],"package":"awsiotsdk","purl":null,"source":"GHSA-743r-5g92-5vgf"},{"ecosystem":"PyPI","fixed":["1.6.1"],"introduced":["0"],"last_affected":[],"package":"awsiotsdk","purl":"pkg:pypi/awsiotsdk","source":"GHSA-743r-5g92-5vgf"},{"ecosystem":"PyPI","fixed":["1.6.1"],"introduced":["0"],"last_affected":[],"package":"awsiotsdk","purl":"pkg:pypi/awsiotsdk","source":"PYSEC-2021-862"},{"ecosystem":"npm","fixed":["1.5.3"],"introduced":["0"],"last_affected":[],"package":"aws-iot-device-sdk-v2","purl":null,"source":"GHSA-743r-5g92-5vgf"},{"ecosystem":"npm","fixed":["1.5.3"],"introduced":["0"],"last_affected":[],"package":"aws-iot-device-sdk-v2","purl":"pkg:npm/aws-iot-device-sdk-v2","source":"GHSA-743r-5g92-5vgf"}],"prev":{"headline":"TLS hostname validation issues within AWS IoT Device SDKs on Windows","id":"CVE-2021-40828"},"products":["AWS IoT Device SDK v2 for C++","AWS IoT Device SDK v2 for Java","AWS IoT Device SDK v2 for Node.js","AWS IoT Device SDK v2 for Python","AWS-C-IO"],"published":"2021-11-22","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-04","vendors":["Amazon Web Services"]},"summary":"AWS IoT Device SDKs on macOS fail to validate TLS hostnames when custom CAs are used, allowing man-in-the-middle attacks.","url":"https://insights.sbomify.com/CVE-2021-40829/"}