Miggo Logo

CVE-2020-4035: DoS via malicious record IDs in WatermelonDB

5.9

CVSS Score
3.1

Basic Information

EPSS Score
0.41059%
Published
6/3/2020
Updated
1/9/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
@nozbe/watermelondbnpm< 0.15.10.15.1
@nozbe/watermelondbnpm>= 0.16.0, < 0.16.20.16.2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot 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.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

## Imp**t M**ium s*v*rity *.* *ttps://www.*irst.or*/*vss/**l*ul*tor/*.*#*VSS:*.*/*V:N/**:*/PR:L/UI:N/S:U/*:N/I:L/*:* * m*li*iously *r**t** r**or* I* **n *xploit * SQL Inj**tion vuln*r**ility in iOS ***pt*r impl*m*nt*tion *n* **us* t** *pp to **l*t*

Reasoning

T** vuln*r**ility st*ms *rom t** iOS ***pt*r's `**stroy**l*t**R**or*s` m*t*o* *onstru*tin* SQL qu*ri*s *y *ir**tly int*rpol*tin* r**or* I*s into t** qu*ry strin* (*s s*own in t** *ommit *i**). T*is *ppro*** *llow** SQL inj**tion w**n untrust** I*s *o