CVE-2021-20327: Mongodb client encryption Improper Certificate Validation Vulnerability
MODERATECVE-2021-20327 is a MODERATE (CVSS 6.8) improper certificate validation vulnerability (CWE-295: Improper Certificate Validation) affecting Mongodb client encryption libraries in the npm ecosystem. The issue involves mongodb-client-encryption vulnerable to improper certificate validation. Remediation is available by upgrading affected packages to version 1.2.1.
CVE-2021-20327 at a Glance
Security Impact
CVSS: 6.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N).
How to Fix CVE-2021-20327
To remediate this vulnerability, upgrade all affected Mongodb client encryption dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install mongodb-client-encryption@1.2.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls mongodb-client-encryption
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2021-20327, inspect your project dependencies using npm:
npm ls mongodb-client-encryption
Analyze the terminal output to locate any version of Mongodb client encryption in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.1), your application is affected.
Note: The npm ls mongodb-client-encryption command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-295: Improper Certificate Validation, where the product does not validate, or incorrectly validates, a certificate. In Mongodb client encryption, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2021-20327 Affected Mongodb client encryption Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
mongodb-client-encryption
|
npm |
≥ 1.2.0
< 1.2.1
All 1 versions
1.2.0
|
1.2.1
|
References
Frequently Asked Questions
What is CVE-2021-20327?
Which Mongodb client encryption versions are affected?
What version fixes CVE-2021-20327?
Is mongodb-client-encryption affected?
What is the CVSS score of CVE-2021-20327?
What CWE is associated with CVE-2021-20327?
How can I check npm dependencies for CVE-2021-20327?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-rjmf-p882-645m",
"modified" : "2024-09-16T22:04:44Z",
"published" : "2021-04-12T18:51:17Z",
"aliases" : [ "CVE-2021-20327" ],
"summary" : "mongodb-client-encryption vulnerable to Improper Certificate Validation",
"details" : "A specific version of the Node.js mongodb-client-encryption module does not perform correct validation of 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 Node.js driver and the KMS service rendering client-side field level encryption (CSFLE) ineffective. This issue was discovered during internal testing and affects mongodb-client-encryption module version 1.2.0, which was available from 2021-Jan-29 and deprecated in the NPM Registry on 2021-Feb-04. This vulnerability does not impact driver traffic payloads with CSFLE-supported key services from applications residing inside the AWS, GCP, and Azure nework fabrics due to compensating controls in these environments. This issue does not impact driver workloads that don’t use Field Level Encryption. This issue affect MongoDB Node.js Driver mongodb-client-encryption module version 1.2.0",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "mongodb-client-encryption"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.2.0"
}, {
"fixed" : "1.2.1"
} ]
} ],
"versions" : [ "1.2.0" ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-20327"
}, {
"type" : "WEB",
"url" : "https://github.com/mongodb/libmongocrypt/commit/76365515ff8754b9f705e56428dd0d7efa7f541b"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mongodb/libmongocrypt"
}, {
"type" : "WEB",
"url" : "https://jira.mongodb.org/browse/NODE-3125"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/1660"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-295" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-03-16T00:00:28Z",
"nvd_published_at" : "2021-02-25T17:15:00Z"
}
}