Lookup for vulnerable packages by Package URL.

Purlpkg:npm/%40nocobase/plugin-workflow-sql@1.8.0-beta.9
Typenpm
Namespace@nocobase
Nameplugin-workflow-sql
Version1.8.0-beta.9
Qualifiers
Subpath
Is_vulnerabletrue
Next_non_vulnerable_version2.0.30
Latest_non_vulnerable_version2.0.30
Affected_by_vulnerabilities
0
url VCID-g133-yvqc-sfa8
vulnerability_id VCID-g133-yvqc-sfa8
summary
NocoBase Has SQL Injection via template variable substitution in workflow SQL node
## 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: ...
  });
```
references
0
reference_url https://api.first.org/data/v1/epss?cve=CVE-2026-34825
reference_id
reference_type
scores
0
value 0.00025
scoring_system epss
scoring_elements 0.07381
published_at 2026-06-05T12:55:00Z
1
value 0.00025
scoring_system epss
scoring_elements 0.0732
published_at 2026-06-08T12:55:00Z
2
value 0.00025
scoring_system epss
scoring_elements 0.07364
published_at 2026-06-07T12:55:00Z
3
value 0.00025
scoring_system epss
scoring_elements 0.07387
published_at 2026-06-06T12:55:00Z
4
value 0.00026
scoring_system epss
scoring_elements 0.07676
published_at 2026-06-09T12:55:00Z
url https://api.first.org/data/v1/epss?cve=CVE-2026-34825
1
reference_url https://github.com/nocobase/nocobase
reference_id
reference_type
scores
0
value 6.5
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N
1
value 8.5
scoring_system cvssv4
scoring_elements 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
2
value HIGH
scoring_system generic_textual
scoring_elements
url https://github.com/nocobase/nocobase
2
reference_url https://github.com/nocobase/nocobase/commit/75da3dddc4aba739c398f7072725dcf7f5487f5c
reference_id
reference_type
scores
0
value 6.5
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N
1
value 8.5
scoring_system cvssv4
scoring_elements 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
2
value HIGH
scoring_system generic_textual
scoring_elements
3
value Track*
scoring_system ssvc
scoring_elements SSVCv2/E:P/A:Y/T:T/P:M/B:A/M:M/D:R/2026-04-03T12:56:37Z/
url https://github.com/nocobase/nocobase/commit/75da3dddc4aba739c398f7072725dcf7f5487f5c
3
reference_url https://github.com/nocobase/nocobase/releases/tag/v2.0.30
reference_id
reference_type
scores
0
value 6.5
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N
1
value 8.5
scoring_system cvssv4
scoring_elements 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
2
value HIGH
scoring_system generic_textual
scoring_elements
3
value Track*
scoring_system ssvc
scoring_elements SSVCv2/E:P/A:Y/T:T/P:M/B:A/M:M/D:R/2026-04-03T12:56:37Z/
url https://github.com/nocobase/nocobase/releases/tag/v2.0.30
4
reference_url https://github.com/nocobase/nocobase/security/advisories/GHSA-vx58-fwwq-5g8j
reference_id
reference_type
scores
0
value 6.5
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N
1
value HIGH
scoring_system cvssv3.1_qr
scoring_elements
2
value 8.5
scoring_system cvssv4
scoring_elements 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
3
value HIGH
scoring_system generic_textual
scoring_elements
4
value Track*
scoring_system ssvc
scoring_elements SSVCv2/E:P/A:Y/T:T/P:M/B:A/M:M/D:R/2026-04-03T12:56:37Z/
url https://github.com/nocobase/nocobase/security/advisories/GHSA-vx58-fwwq-5g8j
5
reference_url https://nvd.nist.gov/vuln/detail/CVE-2026-34825
reference_id
reference_type
scores
0
value 6.5
scoring_system cvssv3.1
scoring_elements CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N
1
value 8.5
scoring_system cvssv4
scoring_elements 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
2
value HIGH
scoring_system generic_textual
scoring_elements
url https://nvd.nist.gov/vuln/detail/CVE-2026-34825
6
reference_url https://github.com/advisories/GHSA-vx58-fwwq-5g8j
reference_id GHSA-vx58-fwwq-5g8j
reference_type
scores
0
value HIGH
scoring_system cvssv3.1_qr
scoring_elements
url https://github.com/advisories/GHSA-vx58-fwwq-5g8j
fixed_packages
0
url pkg:npm/%40nocobase/plugin-workflow-sql@2.0.30
purl pkg:npm/%40nocobase/plugin-workflow-sql@2.0.30
is_vulnerable false
affected_by_vulnerabilities
resource_url http://public2.vulnerablecode.io/packages/pkg:npm/%2540nocobase/plugin-workflow-sql@2.0.30
aliases CVE-2026-34825, GHSA-vx58-fwwq-5g8j
risk_score 4.0
exploitability 0.5
weighted_severity 8.0
resource_url http://public2.vulnerablecode.io/vulnerabilities/VCID-g133-yvqc-sfa8
Fixing_vulnerabilities
Risk_score4.0
Resource_urlhttp://public2.vulnerablecode.io/packages/pkg:npm/%2540nocobase/plugin-workflow-sql@1.8.0-beta.9