CVE-2020-4035: DoS via malicious record IDs in WatermelonDB
5.9
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.41059%
CWE
Published
6/3/2020
Updated
1/9/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
@nozbe/watermelondb | npm | < 0.15.1 | 0.15.1 |
@nozbe/watermelondb | npm | >= 0.16.0, < 0.16.2 | 0.16.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the iOS adapter's destroyDeletedRecords
method constructing SQL queries by directly interpolating record IDs into the query string (as shown in the commit diff). This approach allowed SQL injection when untrusted IDs containing special characters were used. The patch replaced string interpolation with parameterized queries (using '?' placeholders), confirming this was the vulnerable code path. The function
's role in record deletion and the explicit SQL injection mitigation in the patch provide high confidence in this assessment.