{"answers":{"affected":"2 open source packages ship an affected version, including mongodb.driver. It affects 1 product.","exploited":"There is no known exploitation of CVE-2021-20331 in the wild and no public exploit code.","fix":"Upgrade mongodb.driver to 2.12.2 or later.","what":"CVE-2021-20331 is a medium-severity vulnerability in MongoDB C# Driver, published on 13 May 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-20331 and fix it if it is affected.\n\nWhat it is: CVE-2021-20331 is a medium-severity vulnerability in MongoDB C# Driver, published on 13 May 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-20331 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- mongodb.driver (NuGet): affected from 2.11.0; fixed in 2.12.2\n- mongodb.driver (NuGet): affected from 2.11.0; fixed in 2.12.2\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-20331/ (Markdown: https://insights.sbomify.com/CVE-2021-20331/index.md)","id":"CVE-2021-20331","markdown":"https://insights.sbomify.com/CVE-2021-20331/index.md","name":"CVE-2021-20331","record":{"aliases":["GHSA-p9rv-qgqw-jx2w"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read"],"network_reachable":"adjacent_or_local","non_default_config":true,"product_category":"MongoDB C# Driver","requires_auth":"high_privilege","summary":"The MongoDB C# Driver may leak sensitive authentication data to application logs if the command listener feature is enabled.","user_interaction":"required","vuln_class":"information_disclosure"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"mongodb","cpe":[{"product":"c\\#_driver","vendor":"mongodb"}],"cvss":{"score":4.2,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:H/I:N/A:N","version":"3.1"},"cwes":[{"id":"CWE-200","name":"Exposure of Sensitive Information to an Unauthorized Actor"}],"description":"Specific versions of the MongoDB C# Driver may erroneously publish events containing authentication-related data to a command listener configured by an application. The published events may contain security-sensitive data when commands such as \"saslStart\", \"saslContinue\", \"isMaster\", \"createUser\", and \"updateUser\" are executed. Without due care, an application may inadvertently expose this authenticated-related information, e.g., by writing it to a log file. This issue only arises if an application enables the command listener feature (this is not enabled by default). This issue affects the MongoDB C# Driver v2.12 versions prior to and including 2.12.1.","ecosystems":["NuGet"],"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 C# Driver Risk of Exposing Authentication Data via Command Listener","id":"CVE-2021-20331","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"NuGet","product":null,"products":[],"type":"information_disclosure","year":"2021"},"n_packages":2,"n_references":1,"next":{"headline":"Exposure of Sensitive Information to an Unauthorized Actor in MongoDB Rust Driver","id":"CVE-2021-20332"},"packages":[{"ecosystem":"NuGet","fixed":["2.12.2"],"introduced":["2.11.0"],"last_affected":[],"package":"mongodb.driver","purl":null,"source":"GHSA-p9rv-qgqw-jx2w"},{"ecosystem":"NuGet","fixed":["2.12.2"],"introduced":["2.11.0"],"last_affected":[],"package":"mongodb.driver","purl":"pkg:nuget/mongodb.driver","source":"GHSA-p9rv-qgqw-jx2w"}],"prev":{"headline":"Specific replication command with malformed oplog entries can crash secondaries","id":"CVE-2021-20330"},"products":["MongoDB C# Driver"],"published":"2021-05-13","related":[{"cvss_score":7.1,"headline":"Regular expression injection via unescaped characters in LINQ query translation in MongoDB C# Driver","id":"CVE-2026-88026","kev_date_added":null,"published":"2026-09-10"},{"cvss_score":7.1,"headline":"Connection-option injection via unescaped settings in the canonical MongoDB URL builder","id":"CVE-2026-81529","kev_date_added":null,"published":"2026-08-27"},{"cvss_score":6.9,"headline":"NoSQL injection via unquoted constant GroupBy keys in LINQ pipeline translation","id":"CVE-2026-81527","kev_date_added":null,"published":"2026-08-27"},{"cvss_score":6.8,"headline":"KMS master key exposure via unredacted credential serialization in driver settings string","id":"CVE-2026-81530","kev_date_added":null,"published":"2026-08-27"},{"cvss_score":6.6,"headline":"Deserializing compromised object with MongoDB .NET/C# Driver may cause remote code execution","id":"CVE-2022-48282","kev_date_added":null,"published":"2023-02-21"},{"cvss_score":6.1,"headline":"GridFS data disclosure and deletion via query-operator injection in file IDs in the MongoDB C# Driver","id":"CVE-2026-88025","kev_date_added":null,"published":"2026-09-10"},{"cvss_score":5.3,"headline":"NoSQL injection via array replacement bypassing update shape validation in driver write path","id":"CVE-2026-81528","kev_date_added":null,"published":"2026-08-27"}],"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":"partial"},"state":"PUBLISHED","updated":"2024-09-16","vendors":["MongoDB Inc."]},"summary":"The MongoDB C# Driver may leak sensitive authentication data to application logs if the command listener feature is enabled.","url":"https://insights.sbomify.com/CVE-2021-20331/"}