Vulnerabilities in pkg:npm/react-native-mmkv
PACKAGECVE-2024-21668 is a MODERATE (CVSS 4.4) react-native-mmkv insertion of sensitive information vulnerability (CWE-532: Insertion of Sensitive Information into Log File) affecting React native mmkv libraries in the npm ecosystem. The issue involves react-native-mmkv insertion of sensitive information into log file vulnerability. Remediation is available by upgrading affected packages to version 2.11.0.
pkg:npm/react-native-mmkv
Vulnerability advisories affecting package pkg:npm/react-native-mmkv. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-4jh3-6jhv-2mgp | CVE-2024-21668 | MODERATE | react-native-mmkv Insertion of Sensitive Information into Log File vulnerability |
CVE-2024-21668 at a Glance
Security Impact
CVSS: 4.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2024-21668
To remediate this vulnerability, upgrade all affected React native mmkv 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 react-native-mmkv@2.11.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls react-native-mmkv
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-21668, inspect your project dependencies using npm:
npm ls react-native-mmkv
Analyze the terminal output to locate any version of React native mmkv in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.11.0), your application is affected.
Note: The npm ls react-native-mmkv 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-532: Insertion of Sensitive Information into Log File, where the product writes sensitive information to a log file. In React native mmkv, 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-2024-21668 Affected React native mmkv Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
react-native-mmkv
|
npm |
< 2.11.0
|
2.11.0
|
References
Frequently Asked Questions
What is CVE-2024-21668?
Which React native mmkv versions are affected?
What version fixes CVE-2024-21668?
Is react-native-mmkv affected?
What is the CVSS score of CVE-2024-21668?
What CWE is associated with CVE-2024-21668?
How can I check npm dependencies for CVE-2024-21668?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4jh3-6jhv-2mgp",
"modified" : "2024-01-09T21:52:47Z",
"published" : "2024-01-09T19:33:09Z",
"aliases" : [ "CVE-2024-21668" ],
"summary" : "react-native-mmkv Insertion of Sensitive Information into Log File vulnerability",
"details" : "## Summary\nBefore version [v2.11.0](https://github.com/mrousavy/react-native-mmkv/releases/tag/v2.11.0), the react-native-mmkv logged the optional encryption key for the MMKV database into the Android system log. The key can be obtained by anyone with access to the Android Debugging Bridge (ADB) if it is enabled in the phone settings. This bug is not present on iOS devices.\n\n## Details\nThe bridge for communicating between JS code and native code on Android logs the encryption key. This was fixed in commit [a8995cc](https://github.com/mrousavy/react-native-mmkv/commit/a8995ccb7184281f7d168bad3e9987c9bd05f00d) by only logging whether encryption is used.\n\n## Impact\nThe encryption of an MMKV database protects data from higher privilege processes on the phone that can access the app storage. Additionally, if data in the app's storage is encrypted, it is also encrypted in potential backups.\nBy logging the encryption secret to the system logs, attackers can trivially recover the secret by enabling ADB and undermining an app's thread model.\n\nThe bug was discovered and fixed by somebody else. Not me. I'm just reporting this so users of react-native-mmkv upgrade the dependency.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "react-native-mmkv"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.11.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/mrousavy/react-native-mmkv/security/advisories/GHSA-4jh3-6jhv-2mgp"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-21668"
}, {
"type" : "WEB",
"url" : "https://github.com/mrousavy/react-native-mmkv/commit/a8995ccb7184281f7d168bad3e9987c9bd05f00d"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mrousavy/react-native-mmkv"
}, {
"type" : "WEB",
"url" : "https://github.com/mrousavy/react-native-mmkv/releases/tag/v2.11.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-532" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-01-09T19:33:09Z",
"nvd_published_at" : "2024-01-09T19:15:12Z"
}
}