CVE-2022-23510: @cubejs backend/api gateway @cubejs-backend/api-gateway Row Level Security Bypass Vulnerability
HIGHCVE-2022-23510 is a HIGH (CVSS 7.7) @cubejs-backend/api-gateway row level security bypass vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting @cubejs backend/api gateway libraries in the npm ecosystem. The issue involves @cubejs-backend/api-gateway row level security bypass. Remediation is available by upgrading affected packages to version 0.31.24.
CVE-2022-23510 at a Glance
Security Impact
CVSS: 7.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N).
How to Fix CVE-2022-23510
To remediate this vulnerability, upgrade all affected @cubejs backend/api gateway dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @cubejs-backend/api-gateway@0.31.24
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @cubejs-backend/api-gateway
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2022-23510, inspect your project dependencies using npm:
npm ls @cubejs-backend/api-gateway
Analyze the terminal output to locate any version of @cubejs backend/api gateway in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.31.24), your application is affected.
Note: The npm ls @cubejs-backend/api-gateway 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 @cubejs backend/api gateway, 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
CVE-2022-23510 Affected @cubejs backend/api gateway Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@cubejs-backend/api-gateway
|
npm |
≥ 0.31.23
< 0.31.24
All 1 versions
0.31.23
|
0.31.24
|
References
Frequently Asked Questions
What is CVE-2022-23510?
Which @cubejs backend/api gateway versions are affected?
What version fixes CVE-2022-23510?
Is @cubejs-backend/api-gateway affected?
What is the CVSS score of CVE-2022-23510?
What CWE is associated with CVE-2022-23510?
How can I check npm dependencies for CVE-2022-23510?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-6jqm-3c9g-pch7",
"modified" : "2022-12-12T21:28:35Z",
"published" : "2022-12-12T21:28:35Z",
"aliases" : [ "CVE-2022-23510" ],
"summary" : "@cubejs-backend/api-gateway row level security bypass",
"details" : "### Impact\nAll authenticated Cube clients could bypass row-level security and run arbitrary SQL via the newly introduced /v1/sql-runner endpoint.\n\n### Patches\nThe change has been reverted in 0.31.24\n\n### Workarounds\nUpgrade to >=0.31.24 or downgrade to <=0.31.22\n\n### Post mortem\nAs part of implementing the Cube Cloud SQL runner functionality, we’ve added a new endpoint to the Cube Core so that we could add arbitrary queries directly to the queue, bypassing the modeling layer.\n\nThe endpoint was added in this commit: https://github.com/cube-js/cube.js/commit/f1e25bb50323c0b99f3891d349467e7b637baeea\n\nIt went through the code review; however, it slipped everyone’s attention that this endpoint completely bypasses any row-level security logic implemented in the modeling layer. Now anyone with a valid Cube JWT token could fetch any data, even if they were not allowed to do so by their security context.\n\nThe issue was noticed by the Core team on Dec 12 and immediately reverted.\n\nThe just-released 0.31.23 version of the Cube has been pulled out of all the registries, and a CVE was published on Github.\nAnother change (https://github.com/cube-js/cube.js/commit/2c5db32f2ded074ebe5e83668eee8c024101240b) was also rolled back along with the SQL runner endpoint. It didn't pose a significant security threat, but it increased the attacker’s ability to enumerate cube schema, and it should be revisited.\n\nThe 0.31.24 was released to replace the revoked version with a change completely reverted. All customers are urged to upgrade to the newest Cube version.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@cubejs-backend/api-gateway"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.31.23"
}, {
"fixed" : "0.31.24"
} ]
} ],
"versions" : [ "0.31.23" ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/cube-js/cube.js/security/advisories/GHSA-6jqm-3c9g-pch7"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-23510"
}, {
"type" : "WEB",
"url" : "https://github.com/cube-js/cube.js/commit/3c614674fed6ca17df08bbba8c835ef110167570"
}, {
"type" : "WEB",
"url" : "https://github.com/cube-js/cube.js/commit/f1140de508e359970ac82b50bae1c4bf152f6041"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/cube-js/cube.js"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-89" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-12-12T21:28:35Z",
"nvd_published_at" : "2022-12-09T23:15:00Z"
}
}