GHSA-vx58-fwwq-5g8j is a medium-severity (CVSS 6.5) SQL Injection vulnerability in @nocobase/plugin-workflow-sql. O3 Security confirms whether GHSA-vx58-fwwq-5g8j is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
NocoBase Has SQL Injection via template variable substitution in workflow SQL node
Real-World Exposure
@nocobase/plugin-workflow-sqlReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects npm packages — download data is not available via public APIs for these ecosystems.
Description
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:
// SQLInstruction.ts:28
const sql = processor.getParsedValue(node.config.sql || '', node.id).trim();
Then executes the resulting string directly:
// 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:
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
- Login as admin
- Create a collection-trigger workflow on the
userstable (mode: after create) - Add a SQL node with:
SELECT id, nickname, email FROM users WHERE nickname = '{{$context.data.nickname}}'
- Enable the workflow
- Create a user with nickname set to:
' UNION SELECT 1,version(),current_user -- - Check execution result:
[
{
"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:
// 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: ...
});
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @nocobase/plugin-workflow-sql | all versions | 2.0.30 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @nocobase/plugin-workflow-sql. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update @nocobase/plugin-workflow-sql to 2.0.30 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-vx58-fwwq-5g8j is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-vx58-fwwq-5g8j is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-vx58-fwwq-5g8j. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-vx58-fwwq-5g8j in your dependencies?
O3 detects GHSA-vx58-fwwq-5g8j across npm dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.