{"answers":{"affected":"28 open source packages ship an affected version, including org.mongodb:mongo-java-driver, org.mongodb:mongodb-driver and org.mongodb:mongodb-driver-legacy. It affects 2 products.","exploited":"There is no known exploitation of CVE-2021-20328 in the wild and no public exploit code.","fix":"Upgrade org.mongodb:mongo-java-driver to a fixed version for your release line: 3.11.3 or 3.12.8.","what":"CVE-2021-20328 is a medium-severity vulnerability in MongoDB Inc. mongo-java-driver, published on 25 Feb 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-20328 and fix it if it is affected.\n\nWhat it is: CVE-2021-20328 is a medium-severity vulnerability in MongoDB Inc. mongo-java-driver, published on 25 Feb 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-20328 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- org.mongodb:mongo-java-driver (Maven): affected from 3.11.0; fixed in 3.11.3\n- org.mongodb:mongo-java-driver (Maven): affected from 3.11.0; fixed in 3.11.3\n- org.mongodb:mongo-java-driver (Maven): affected from 3.12.0; fixed in 3.12.8\n- org.mongodb:mongo-java-driver (Maven): affected from 3.12.0; fixed in 3.12.8\n- org.mongodb:mongodb-driver (Maven): affected from 3.11.0; fixed in 3.11.3\n- org.mongodb:mongodb-driver (Maven): affected from 3.11.0; fixed in 3.11.3\n- org.mongodb:mongodb-driver (Maven): affected from 3.12.0; fixed in 3.12.8\n- org.mongodb:mongodb-driver (Maven): affected from 3.12.0; fixed in 3.12.8\n- org.mongodb:mongodb-driver-legacy (Maven): affected from 3.11.0; fixed in 3.11.3\n- org.mongodb:mongodb-driver-legacy (Maven): affected from 3.11.0; fixed in 3.11.3\n- org.mongodb:mongodb-driver-legacy (Maven): affected from 3.12.0; fixed in 3.12.8\n- org.mongodb:mongodb-driver-legacy (Maven): affected from 3.12.0; fixed in 3.12.8\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-20328/ (Markdown: https://insights.sbomify.com/CVE-2021-20328/index.md)","id":"CVE-2021-20328","markdown":"https://insights.sbomify.com/CVE-2021-20328/index.md","name":"CVE-2021-20328","record":{"aliases":["GHSA-rghw-6px2-fgwc","UBUNTU-CVE-2021-20328"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read","security_bypass"],"network_reachable":"adjacent_or_local","non_default_config":true,"product_category":"MongoDB Java driver","requires_auth":"none","summary":"Attackers with privileged network position can intercept traffic and bypass field-level encryption in MongoDB Java drivers due to missing KMS host name verification.","user_interaction":"required","vuln_class":"security_feature_bypass"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"mongodb","cpe":[{"product":"java_driver","vendor":"mongodb"},{"product":"quarkus","vendor":"quarkus"}],"cvss":{"score":6.4,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N","version":"3.1"},"cwes":[{"id":"CWE-295","name":"Improper Certificate Validation"}],"description":"Specific versions of the Java driver that support client-side field level encryption (CSFLE) fail to perform correct host name verification on the KMS server’s certificate. This vulnerability in combination with a privileged network position active MITM attack could result in interception of traffic between the Java driver and the KMS service rendering Field Level Encryption ineffective. This issue was discovered during internal testing and affects all versions of the Java driver that support CSFLE. The Java async, Scala, and reactive streams drivers are not impacted. This vulnerability does not impact driver traffic payloads with CSFLE-supported key services originating from applications residing inside the AWS, GCP, and Azure network fabrics due to compensating controls in these environments. This issue does not impact driver workloads that don’t use Field Level Encryption.","ecosystems":["Maven"],"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":"MongoDB Java driver client-side field level encryption not verifying KMS host name","id":"CVE-2021-20328","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Maven","product":null,"products":[],"type":"security_feature_bypass","year":"2021"},"n_packages":28,"n_references":1,"next":{"headline":"Specific cstrings input may not be properly validated in the Go Driver","id":"CVE-2021-20329"},"packages":[{"ecosystem":"Maven","fixed":["3.11.3"],"introduced":["3.11.0"],"last_affected":[],"package":"org.mongodb:mongo-java-driver","purl":null,"source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["3.11.3"],"introduced":["3.11.0"],"last_affected":[],"package":"org.mongodb:mongo-java-driver","purl":"pkg:maven/org.mongodb/mongo-java-driver","source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["3.12.8"],"introduced":["3.12.0"],"last_affected":[],"package":"org.mongodb:mongo-java-driver","purl":null,"source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["3.12.8"],"introduced":["3.12.0"],"last_affected":[],"package":"org.mongodb:mongo-java-driver","purl":"pkg:maven/org.mongodb/mongo-java-driver","source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["3.11.3"],"introduced":["3.11.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver","purl":null,"source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["3.11.3"],"introduced":["3.11.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver","purl":"pkg:maven/org.mongodb/mongodb-driver","source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["3.12.8"],"introduced":["3.12.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver","purl":null,"source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["3.12.8"],"introduced":["3.12.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver","purl":"pkg:maven/org.mongodb/mongodb-driver","source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["3.11.3"],"introduced":["3.11.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver-legacy","purl":null,"source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["3.11.3"],"introduced":["3.11.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver-legacy","purl":"pkg:maven/org.mongodb/mongodb-driver-legacy","source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["3.12.8"],"introduced":["3.12.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver-legacy","purl":null,"source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["3.12.8"],"introduced":["3.12.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver-legacy","purl":"pkg:maven/org.mongodb/mongodb-driver-legacy","source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["4.0.6"],"introduced":["4.0.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver-legacy","purl":null,"source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["4.0.6"],"introduced":["4.0.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver-legacy","purl":"pkg:maven/org.mongodb/mongodb-driver-legacy","source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["4.1.2"],"introduced":["4.1.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver-legacy","purl":null,"source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["4.1.2"],"introduced":["4.1.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver-legacy","purl":"pkg:maven/org.mongodb/mongodb-driver-legacy","source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["4.2.1"],"introduced":["4.2.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver-legacy","purl":null,"source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["4.2.1"],"introduced":["4.2.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver-legacy","purl":"pkg:maven/org.mongodb/mongodb-driver-legacy","source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["3.11.3"],"introduced":["3.11.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver-sync","purl":null,"source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["3.11.3"],"introduced":["3.11.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver-sync","purl":"pkg:maven/org.mongodb/mongodb-driver-sync","source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["3.12.8"],"introduced":["3.12.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver-sync","purl":null,"source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["3.12.8"],"introduced":["3.12.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver-sync","purl":"pkg:maven/org.mongodb/mongodb-driver-sync","source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["4.0.6"],"introduced":["4.0.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver-sync","purl":null,"source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["4.0.6"],"introduced":["4.0.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver-sync","purl":"pkg:maven/org.mongodb/mongodb-driver-sync","source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["4.1.2"],"introduced":["4.1.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver-sync","purl":null,"source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["4.1.2"],"introduced":["4.1.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver-sync","purl":"pkg:maven/org.mongodb/mongodb-driver-sync","source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["4.2.1"],"introduced":["4.2.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver-sync","purl":null,"source":"GHSA-rghw-6px2-fgwc"},{"ecosystem":"Maven","fixed":["4.2.1"],"introduced":["4.2.0"],"last_affected":[],"package":"org.mongodb:mongodb-driver-sync","purl":"pkg:maven/org.mongodb/mongodb-driver-sync","source":"GHSA-rghw-6px2-fgwc"}],"prev":{"headline":"MongoDB Node.js client side field level encryption library may not be validating KMS certificate","id":"CVE-2021-20327"},"products":["mongo-java-driver","mongodb-driver","mongodb-driver-legacy","mongodb-driver-sync"],"published":"2021-02-25","related":[{"cvss_score":8.2,"headline":"Application denial of service via cancellation race in reactive client-side encryption in MongoDB Java Driver","id":"CVE-2026-88032","kev_date_added":null,"published":"2026-09-10"},{"cvss_score":8.2,"headline":"Cleartext Storage of Sensitive Information in MongoDB Driver Logging During Client Initialization","id":"CVE-2026-18710","kev_date_added":null,"published":"2026-08-11"},{"cvss_score":6.1,"headline":"GridFS data disclosure and deletion via query-operator injection in file IDs in the MongoDB Java Driver","id":"CVE-2026-88033","kev_date_added":null,"published":"2026-09-10"}],"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":"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":"no","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2024-09-16","vendors":["MongoDB Inc."]},"summary":"Attackers with privileged network position can intercept traffic and bypass field-level encryption in MongoDB Java drivers due to missing KMS host name verification.","url":"https://insights.sbomify.com/CVE-2021-20328/"}