{"id":"CVE-2020-4035","published":"2020-06-03T16:50:12Z","modified":"2024-08-04T07:52:20Z","title":"DoS or local data modification via malicious record IDs in WatermelonDB","vendor":"Nozbe","product":"WatermelonDB","tier":"tail","description":{"text":"In WatermelonDB (NPM package \"@nozbe/watermelondb\") before versions 0.15.1 and 0.16.2, a maliciously crafted record ID can exploit a SQL Injection vulnerability in iOS adapter implementation and cause the app to delete all or selected records from the database, generally causing the app to become unusable. This may happen in apps that don't validate IDs (valid IDs are `/^[a-zA-Z0-9_-.]+$/`) and use Watermelon Sync or low-level `database.adapter.destroyDeletedRecords` method. The integrity risk is low due to the fact that maliciously deleted records won't synchronize, so logout-login will restore all data, although some local changes may be lost if the malicious deletion causes the sync process to fail to proceed to push stage. No way to breach confidentiality with this vulnerability is known. Full exploitation of SQL Injection is mitigated, because it's not possible to nest an insert/update query inside a delete query in SQLite, and it's not possible to pass a semicolon-separated second query. There's also no known practicable way to breach confidentiality by selectively deleting records, because those records will not be synchronized. It's theoretically possible that selective record deletion could cause an app to behave insecurely if lack of a record is used to make security decisions by the app. This is patched in versions 0.15.1, 0.16.2, and 0.16.1-fix","provenance":"source","from":"CVE.org"},"cvss":{"score":5.9,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00763,"percentile":0.5629,"provenance":"source"},"cwes":[{"id":"CWE-89","name":"Improper Neutralization of Special Elements used in an SQL Command"}],"references":[{"url":"https://github.com/Nozbe/WatermelonDB/security/advisories/GHSA-38f9-m297-6q9g","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/Nozbe/WatermelonDB/commit/924c7ae2a8d7d6459656751e5b9b1bf91a218025","tags":["x_refsource_MISC"]}],"priority":{"score":15.4,"factors":[{"name":"EPSS percentile","points":11.26},{"name":"CVSS severity","points":4.13}]},"vendorSlug":"nozbe","affectedVersions":[{"vendor":"Nozbe","product":"WatermelonDB","versions":["< 0.15.1",">= 0.16.0, < 0.16.2"]}],"affected":[{"ecosystem":"npm","package":"@nozbe/watermelondb","vulnerableRanges":["<0.15.1",">=0.16.0, <0.16.2"],"patched":["0.15.1","0.16.2"],"from":["GHSA-38f9-m297-6q9g"],"provenance":"source"}],"summary":{"text":"A SQL injection flaw in the iOS adapter of Nozbe's WatermelonDB (the @nozbe/watermelondb NPM package) lets a maliciously crafted record ID delete all or selected records from the local database, typically rendering the app unusable. An attacker needs to supply a crafted record ID to an app that does not validate IDs and that uses Watermelon Sync or the low-level database.adapter.destroyDeletedRecords method, and the attack requires network access and low privileges.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:32:04Z"},"euvd":{"id":"EUVD-2020-0454","exploited":false,"provenance":"source"}}