{"answers":{"affected":"4 open source packages ship an affected version, including @nozbe/watermelondb. It affects 1 product.","exploited":"There is no known exploitation of CVE-2020-4035 in the wild and no public exploit code.","fix":"Upgrade @nozbe/watermelondb to a fixed version for your release line: 0.15.1 or 0.16.2.","what":"CVE-2020-4035 is a medium-severity SQL injection vulnerability in Nozbe WatermelonDB, published on 3 Jun 2020. Any signed-in user can exploit it over the network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2020-4035 and fix it if it is affected.\n\nWhat it is: CVE-2020-4035 is a medium-severity SQL injection vulnerability in Nozbe WatermelonDB, published on 3 Jun 2020. Any signed-in user can exploit it over the network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2020-4035 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- @nozbe/watermelondb (npm): affected all versions; fixed in 0.15.1\n- @nozbe/watermelondb (npm): affected all versions; fixed in 0.15.1\n- @nozbe/watermelondb (npm): affected from 0.16.0; fixed in 0.16.2\n- @nozbe/watermelondb (npm): affected from 0.16.0; fixed in 0.16.2\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2020-4035/ (Markdown: https://insights.sbomify.com/CVE-2020-4035/index.md)","id":"CVE-2020-4035","markdown":"https://insights.sbomify.com/CVE-2020-4035/index.md","name":"CVE-2020-4035","record":{"aliases":["GHSA-38f9-m297-6q9g"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_modify","denial_of_service"],"network_reachable":"yes","non_default_config":true,"product_category":"WatermelonDB library","requires_auth":"low_privilege","summary":"Attackers can delete database records via SQL injection in WatermelonDB iOS adapter, causing app unavailability or data loss.","user_interaction":"not_required","vuln_class":"sql_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"watermelondb","vendor":"nozbe"}],"cvss":{"score":5.9,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:H","version":"3.1"},"cwes":[{"id":"CWE-89","name":"Improper Neutralization of Special Elements used in an SQL Command"}],"description":"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","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"DoS or local data modification via malicious record IDs in WatermelonDB","id":"CVE-2020-4035","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"sql_injection","year":"2020"},"n_packages":4,"n_references":2,"next":{"headline":"Open Redirect in OAuth2 Proxy","id":"CVE-2020-4037"},"packages":[{"ecosystem":"npm","fixed":["0.15.1"],"introduced":["0"],"last_affected":[],"package":"@nozbe/watermelondb","purl":null,"source":"GHSA-38f9-m297-6q9g"},{"ecosystem":"npm","fixed":["0.15.1"],"introduced":["0"],"last_affected":[],"package":"@nozbe/watermelondb","purl":"pkg:npm/%40nozbe/watermelondb","source":"GHSA-38f9-m297-6q9g"},{"ecosystem":"npm","fixed":["0.16.2"],"introduced":["0.16.0"],"last_affected":[],"package":"@nozbe/watermelondb","purl":null,"source":"GHSA-38f9-m297-6q9g"},{"ecosystem":"npm","fixed":["0.16.2"],"introduced":["0.16.0"],"last_affected":[],"package":"@nozbe/watermelondb","purl":"pkg:npm/%40nozbe/watermelondb","source":"GHSA-38f9-m297-6q9g"}],"prev":{"headline":"OOB Read in RLEDECOMPRESS in FreeRDP","id":"CVE-2020-4033"},"products":["WatermelonDB"],"published":"2020-06-03","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-04","vendors":["Nozbe"]},"summary":"Attackers can delete database records via SQL injection in WatermelonDB iOS adapter, causing app unavailability or data loss.","url":"https://insights.sbomify.com/CVE-2020-4035/"}