{"answers":{"affected":"2 open source packages ship an affected version, including @nocobase/database. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-41640 exists.","fix":"Upgrade @nocobase/database to 2.0.39 or later.","what":"CVE-2026-41640 is a high-severity SQL injection vulnerability in nocobase, published on 7 May 2026. Any signed-in user can exploit it over the network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2026-41640 and fix it if it is affected.\n\nWhat it is: CVE-2026-41640 is a high-severity SQL injection vulnerability in nocobase, published on 7 May 2026. Any signed-in user can exploit it over the network, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-41640 exists.\n\nAffected packages and fixed versions:\n- @nocobase/database (npm): affected all versions; fixed in 2.0.39\n- @nocobase/database (npm): affected all versions; fixed in 2.0.39\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-2026-41640/ (Markdown: https://insights.sbomify.com/CVE-2026-41640/index.md)","id":"CVE-2026-41640","markdown":"https://insights.sbomify.com/CVE-2026-41640/index.md","name":"CVE-2026-41640","record":{"aliases":["GHSA-4948-f92q-f432"],"analysis":{"component_type":"web_application","fix_type":"upgrade","impacts":["code_execution","data_read"],"network_reachable":"yes","non_default_config":false,"product_category":"NocoBase low-code platform","requires_auth":"low_privilege","summary":"Attackers can inject arbitrary SQL via malicious primary keys in NocoBase, potentially leading to code execution or data theft.","user_interaction":"not_required","vuln_class":"sql_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"nocobase","vendor":"nocobase"}],"cvss":{"score":7.5,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-89","name":"Improper Neutralization of Special Elements used in an SQL Command"}],"description":"NocoBase is an AI-powered no-code/low-code platform for building business applications and enterprise solutions. Prior to version 2.0.39, the queryParentSQL() function in the core database package constructs a recursive CTE query by joining nodeIds with string concatenation instead of using parameterized queries. The nodeIds array contains primary key values read from database rows. An attacker who can create a record with a malicious string primary key can inject arbitrary SQL when any subsequent request triggers recursive eager loading on that collection. This issue has been patched in version 2.0.39.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":1,"refs":[{"date":null,"kind":"nuclei","ref":"http/cves/2026/CVE-2026-41640.yaml","stars":null,"title":"NocoBase - SQL Injection"}],"tier":"weaponised"},"has_fix":true,"headline":"NocoBase Vulnerable to SQL Injection via String Concatenation in Recursive Eager Loading","id":"CVE-2026-41640","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"sql_injection","year":"2026"},"n_packages":2,"n_references":4,"next":{"headline":"NocoBase Vulnerable to SQL Validation Bypass via `sqlCollection:update` Missing `checkSQL` Call","id":"CVE-2026-41641"},"packages":[{"ecosystem":"npm","fixed":["2.0.39"],"introduced":["0"],"last_affected":[],"package":"@nocobase/database","purl":null,"source":"GHSA-4948-f92q-f432"},{"ecosystem":"npm","fixed":["2.0.39"],"introduced":["0"],"last_affected":[],"package":"@nocobase/database","purl":"pkg:npm/%40nocobase/database","source":"GHSA-4948-f92q-f432"}],"prev":{"headline":"Degradation of resolution service from improperly accounted client-terminated DNS-over-QUIC queries","id":"CVE-2026-41637"},"products":["nocobase"],"published":"2026-05-07","related":[{"cvss_score":10,"headline":"NocoBase Affected by Sandbox Escape to RCE via console._stdout Prototype Chain Traversal in Workflow Script Node","id":"CVE-2026-34156","kev_date_added":null,"published":"2026-03-31"},{"cvss_score":8.5,"headline":"NocoBase Has SQL Injection via template variable substitution in workflow SQL node","id":"CVE-2026-34825","kev_date_added":null,"published":"2026-04-02"},{"cvss_score":7.2,"headline":"NocoBase Vulnerable to SQL Validation Bypass via `sqlCollection:update` Missing `checkSQL` Call","id":"CVE-2026-41641","kev_date_added":null,"published":"2026-05-07"},{"cvss_score":6.4,"headline":"NocoBase has SSRF in Workflow HTTP Request and Custom Request Plugins","id":"CVE-2026-40346","kev_date_added":null,"published":"2026-04-17"}],"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)"},{"class":"attribution","licence":"MIT","name":"Nuclei templates"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"total"},"state":"PUBLISHED","updated":"2026-05-07","vendors":["nocobase"]},"summary":"Attackers can inject arbitrary SQL via malicious primary keys in NocoBase, potentially leading to code execution or data theft.","url":"https://insights.sbomify.com/CVE-2026-41640/"}