Vulnerabilities in pkg:npm/@nocobase/plugin-workflow-sql

PACKAGE
Advisory Identifier: GHSA-vx58-fwwq-5g8j
Advisory Summary

CVE-2026-34825 is a HIGH (CVSS 6.5) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting @nocobase/plugin workflow sql libraries in the npm ecosystem. The issue involves nocobase has sql injection via template variable substitution in workflow sql node. Remediation is available by upgrading affected packages to version 2.0.30.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@nocobase/plugin-workflow-sql

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@nocobase/plugin-workflow-sql. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-vx58-fwwq-5g8j CVE-2026-34825 HIGH NocoBase Has SQL Injection via template variable substitution in workflow SQL node

CVE-2026-34825 at a Glance

CVE Identifier CVE-2026-34825
GHSA Identifier GHSA-vx58-fwwq-5g8j
Severity HIGH
CVSS v3.1 Base Score 6.5
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product @nocobase/plugin workflow sql
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-34825

To remediate this vulnerability, upgrade all affected @nocobase/plugin workflow sql dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@nocobase/plugin-workflow-sql fixed: 2.0.30
npm install @nocobase/plugin-workflow-sql@2.0.30
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @nocobase/plugin-workflow-sql

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-34825, inspect your project dependencies using npm:

npm ls @nocobase/plugin-workflow-sql

Analyze the terminal output to locate any version of @nocobase/plugin workflow sql in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.30), your application is affected.

Note: The npm ls @nocobase/plugin-workflow-sql command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In @nocobase/plugin workflow sql, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary NocoBase <= 2.0.8 `plugin-workflow-sql` substitutes template variables directly into raw SQL strings via `getParsedValue()` without parameterization or escaping. Any user who triggers a workflow containing a SQL node with template variables from user-controlled data can inject arbitrary SQL. ## Affected Versions - Affected: all versions through 2.0.8 ## Details The `SQLInstruction` in `packages/plugins/@nocobase/plugin-workflow-sql/src/server/SQLInstruction.ts` line 28 processes SQL templates: ```typescript // SQLInstruction.ts:28 const sql = processor.getParsedValue(node.config.sql || '', node.id).trim(); ``` Then executes the resulting string directly: ```typescript // SQLInstruction.ts:35 const [result] = await collectionManager.db.sequelize.query(sql, { transaction: this.workflow.useDataSourceTransaction(dataSourceName, processor.transaction), }); ``` `getParsedValue()` performs simple string substitution of `{{$context.data.fieldName}}` placeholders with values from the workflow trigger data. No escaping, quoting, or parameterized binding is applied. When an admin creates a SQL node with a template like: ```sql SELECT * FROM users WHERE nickname = '{{$context.data.nickname}}' ``` Any user who triggers the workflow with a crafted value can break out of the string literal and inject arbitrary SQL. ## Proof of Concept 1. Login as admin 2. Create a collection-trigger workflow on the `users` table (mode: after create) 3. Add a SQL node with: ```sql SELECT id, nickname, email FROM users WHERE nickname = '{{$context.data.nickname}}' ``` 4. Enable the workflow 5. Create a user with nickname set to: `' UNION SELECT 1,version(),current_user --` 6. Check execution result: ```json [ { "id": 1, "nickname": "PostgreSQL 16.13 (Debian 16.13-1.pgdg13+1) on x86_64-pc-linux-gnu...", "email": "nocobase" } ] ``` The injected UNION SELECT returned the database version and current database user. ## Impact Full database read/write access through SQL injection. An attacker who can trigger a workflow with a SQL node containing template variables from user-controlled data can extract credentials, modify records, or drop tables. The severity depends on the database user's privileges (full superuser access in the default Docker deployment). ## Suggested Fix Use parameterized queries. Replace direct string substitution with Sequelize bind parameters: ```diff // SQLInstruction.ts - const sql = processor.getParsedValue(node.config.sql || '', node.id).trim(); + const { sql, bind } = processor.getParsedValueAsParams(node.config.sql || '', node.id); const [result] = await collectionManager.db.sequelize.query(sql, { + bind, transaction: ... }); ```

CVE-2026-34825 Affected @nocobase/plugin workflow sql Versions

1 component(s)
Fixed Versions:
2.0.30
Product / Package Ecosystem Affected Versions Fixed Version
@nocobase/plugin-workflow-sql
npm
< 2.0.30
2.0.30

References

Frequently Asked Questions

What is CVE-2026-34825?
CVE-2026-34825 is a security vulnerability in @nocobase/plugin workflow sql involving NocoBase Has SQL Injection via template variable substitution in workflow SQL node under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which @nocobase/plugin workflow sql versions are affected?
Affected versions include releases prior to 2.0.30 across affected packages: @nocobase/plugin-workflow-sql.
What version fixes CVE-2026-34825?
Upgrading to 2.0.30 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @nocobase/plugin-workflow-sql affected?
Yes, @nocobase/plugin-workflow-sql is affected in releases prior to 2.0.30. Upgrade your dependency to 2.0.30 or later.
What is the CVSS score of CVE-2026-34825?
CVE-2026-34825 has a CVSS v3.1 base score of 6.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2026-34825?
CVE-2026-34825 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check npm dependencies for CVE-2026-34825?
Run the dependency tree command: 'npm ls @nocobase/plugin-workflow-sql'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vx58-fwwq-5g8j",
  "modified" : "2026-04-10T17:32:48Z",
  "published" : "2026-04-01T23:44:37Z",
  "aliases" : [ "CVE-2026-34825" ],
  "summary" : "NocoBase Has SQL Injection via template variable substitution in workflow SQL node",
  "details" : "## Summary\n\nNocoBase <= 2.0.8 `plugin-workflow-sql` substitutes template variables directly into raw SQL strings via `getParsedValue()` without parameterization or escaping. Any user who triggers a workflow containing a SQL node with template variables from user-controlled data can inject arbitrary SQL.\n\n## Affected Versions\n\n- Affected: all versions through 2.0.8\n\n## Details\n\nThe `SQLInstruction` in `packages/plugins/@nocobase/plugin-workflow-sql/src/server/SQLInstruction.ts` line 28 processes SQL templates:\n\n```typescript\n// SQLInstruction.ts:28\nconst sql = processor.getParsedValue(node.config.sql || '', node.id).trim();\n```\n\nThen executes the resulting string directly:\n\n```typescript\n// SQLInstruction.ts:35\nconst [result] = await collectionManager.db.sequelize.query(sql, {\n  transaction: this.workflow.useDataSourceTransaction(dataSourceName, processor.transaction),\n});\n```\n\n`getParsedValue()` performs simple string substitution of `{{$context.data.fieldName}}` placeholders with values from the workflow trigger data. No escaping, quoting, or parameterized binding is applied.\n\nWhen an admin creates a SQL node with a template like:\n```sql\nSELECT * FROM users WHERE nickname = '{{$context.data.nickname}}'\n```\n\nAny user who triggers the workflow with a crafted value can break out of the string literal and inject arbitrary SQL.\n\n## Proof of Concept\n\n1. Login as admin\n2. Create a collection-trigger workflow on the `users` table (mode: after create)\n3. Add a SQL node with:\n```sql\nSELECT id, nickname, email FROM users WHERE nickname = '{{$context.data.nickname}}'\n```\n4. Enable the workflow\n5. Create a user with nickname set to: `' UNION SELECT 1,version(),current_user --`\n6. Check execution result:\n\n```json\n[\n  {\n    \"id\": 1,\n    \"nickname\": \"PostgreSQL 16.13 (Debian 16.13-1.pgdg13+1) on x86_64-pc-linux-gnu...\",\n    \"email\": \"nocobase\"\n  }\n]\n```\n\nThe injected UNION SELECT returned the database version and current database user.\n\n## Impact\n\nFull database read/write access through SQL injection. An attacker who can trigger a workflow with a SQL node containing template variables from user-controlled data can extract credentials, modify records, or drop tables. The severity depends on the database user's privileges (full superuser access in the default Docker deployment).\n\n## Suggested Fix\n\nUse parameterized queries. Replace direct string substitution with Sequelize bind parameters:\n\n```diff\n// SQLInstruction.ts\n- const sql = processor.getParsedValue(node.config.sql || '', node.id).trim();\n+ const { sql, bind } = processor.getParsedValueAsParams(node.config.sql || '', node.id);\n  const [result] = await collectionManager.db.sequelize.query(sql, {\n+   bind,\n    transaction: ...\n  });\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@nocobase/plugin-workflow-sql"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.0.30"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.0.29"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nocobase/nocobase/security/advisories/GHSA-vx58-fwwq-5g8j"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-34825"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nocobase/nocobase/commit/75da3dddc4aba739c398f7072725dcf7f5487f5c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nocobase/nocobase"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nocobase/nocobase/releases/tag/v2.0.30"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-01T23:44:37Z",
    "nvd_published_at" : "2026-04-02T20:16:26Z"
  }
}