Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS00amgzLTZqaHYtMm1ncM4AA4Tj

react-native-mmkv Insertion of Sensitive Information into Log File vulnerability

Summary

Before version 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.

Details

The bridge for communicating between JS code and native code on Android logs the encryption key. This was fixed in commit a8995cc by only logging whether encryption is used.

Impact

The 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.
By logging the encryption secret to the system logs, attackers can trivially recover the secret by enabling ADB and undermining an app's thread model.

The bug was discovered and fixed by somebody else. Not me. I'm just reporting this so users of react-native-mmkv upgrade the dependency.

Permalink: https://github.com/advisories/GHSA-4jh3-6jhv-2mgp
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS00amgzLTZqaHYtMm1ncM4AA4Tj
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: 11 months ago
Updated: 11 months ago


CVSS Score: 4.4
CVSS vector: CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N

Identifiers: GHSA-4jh3-6jhv-2mgp, CVE-2024-21668
References: Repository: https://github.com/mrousavy/react-native-mmkv
Blast Radius: 11.9

Affected Packages

npm:react-native-mmkv
Dependent packages: 57
Dependent repositories: 500
Downloads: 852,828 last month
Affected Version Ranges: < 2.11.0
Fixed in: 2.11.0
All affected versions: 0.1.1, 0.1.3, 0.1.5, 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.1.10, 0.1.11, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.0.9, 1.0.10, 1.0.11, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.4.0, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 2.0.0, 2.0.1, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.5.0, 2.5.1, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.7.0, 2.8.0, 2.9.0, 2.10.0, 2.10.1, 2.10.2
All unaffected versions: 2.11.0, 2.12.0, 2.12.1, 2.12.2, 3.0.0, 3.0.1, 3.0.2, 3.1.0