{"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 2 products.","exploited":"There is no known exploitation of CVE-2021-40828 in the wild and no public exploit code.","fix":"Upgrade software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk to 1.3.3 or later.","what":"CVE-2021-40828 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-40828 and fix it if it is affected.\n\nWhat it is: CVE-2021-40828 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-40828 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.3.3\n- software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk (Maven): affected all versions; fixed in 1.3.3\n- awsiotsdk (PyPI): affected all versions; fixed in 1.5.18\n- awsiotsdk (PyPI): affected all versions; fixed in 1.5.18\n- awsiotsdk (PyPI): affected all versions; fixed in 1.5.18\n- aws-iot-device-sdk-v2 (npm): affected all versions; fixed in 1.5.1\n- aws-iot-device-sdk-v2 (npm): affected all versions; fixed in 1.5.1\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-40828/ (Markdown: https://insights.sbomify.com/CVE-2021-40828/index.md)","id":"CVE-2021-40828","markdown":"https://insights.sbomify.com/CVE-2021-40828/index.md","name":"CVE-2021-40828","record":{"aliases":["GHSA-94jq-q5v2-76wj","PYSEC-2021-861"],"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 Windows 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_aws-c-io","vendor":"amazon"},{"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.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.","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 Windows","id":"CVE-2021-40828","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":"TLS hostname validation issues within AWS IoT Device SDKs on macOS","id":"CVE-2021-40829"},"packages":[{"ecosystem":"Maven","fixed":["1.3.3"],"introduced":["0"],"last_affected":[],"package":"software.amazon.awssdk.iotdevicesdk:aws-iot-device-sdk","purl":null,"source":"GHSA-94jq-q5v2-76wj"},{"ecosystem":"Maven","fixed":["1.3.3"],"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-94jq-q5v2-76wj"},{"ecosystem":"PyPI","fixed":["1.5.18"],"introduced":["0"],"last_affected":[],"package":"awsiotsdk","purl":null,"source":"GHSA-94jq-q5v2-76wj"},{"ecosystem":"PyPI","fixed":["1.5.18"],"introduced":["0"],"last_affected":[],"package":"awsiotsdk","purl":"pkg:pypi/awsiotsdk","source":"GHSA-94jq-q5v2-76wj"},{"ecosystem":"PyPI","fixed":["1.5.18"],"introduced":["0"],"last_affected":[],"package":"awsiotsdk","purl":"pkg:pypi/awsiotsdk","source":"PYSEC-2021-861"},{"ecosystem":"npm","fixed":["1.5.1"],"introduced":["0"],"last_affected":[],"package":"aws-iot-device-sdk-v2","purl":null,"source":"GHSA-94jq-q5v2-76wj"},{"ecosystem":"npm","fixed":["1.5.1"],"introduced":["0"],"last_affected":[],"package":"aws-iot-device-sdk-v2","purl":"pkg:npm/aws-iot-device-sdk-v2","source":"GHSA-94jq-q5v2-76wj"}],"prev":{"headline":"Memory corruption in n/a","id":"CVE-2021-40827"},"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":[{"cvss_score":6.3,"headline":"Inconsistent CA override function behavior within AWS IoT Device SDKs on Unix systems","id":"CVE-2021-40830","kev_date_added":null,"published":"2021-11-22"},{"cvss_score":6.3,"headline":"Missing SNI validation and inconsistent CA override function behavior within AWS IoT Device SDKs on Apple devices","id":"CVE-2021-40831","kev_date_added":null,"published":"2021-11-22"}],"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 Windows fail to validate TLS hostnames when custom CAs are used, allowing man-in-the-middle attacks.","url":"https://insights.sbomify.com/CVE-2021-40828/"}