GHSA-6JQM-3C9G-PCH7
Vulnerability from github – Published: 2022-12-12 21:28 – Updated: 2022-12-12 21:28Impact
All authenticated Cube clients could bypass row-level security and run arbitrary SQL via the newly introduced /v1/sql-runner endpoint.
Patches
The change has been reverted in 0.31.24
Workarounds
Upgrade to >=0.31.24 or downgrade to <=0.31.22
Post mortem
As 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.
The endpoint was added in this commit: https://github.com/cube-js/cube.js/commit/f1e25bb50323c0b99f3891d349467e7b637baeea
It 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.
The issue was noticed by the Core team on Dec 12 and immediately reverted.
The just-released 0.31.23 version of the Cube has been pulled out of all the registries, and a CVE was published on Github. Another 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.
The 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.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "@cubejs-backend/api-gateway"
},
"ranges": [
{
"events": [
{
"introduced": "0.31.23"
},
{
"fixed": "0.31.24"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"0.31.23"
]
}
],
"aliases": [
"CVE-2022-23510"
],
"database_specific": {
"cwe_ids": [
"CWE-89"
],
"github_reviewed": true,
"github_reviewed_at": "2022-12-12T21:28:35Z",
"nvd_published_at": "2022-12-09T23:15:00Z",
"severity": "HIGH"
},
"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 \u003e=0.31.24 or downgrade to \u003c=0.31.22\n\n### Post mortem\nAs part of implementing the Cube Cloud SQL runner functionality, we\u2019ve 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\u2019s 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\u0027t pose a significant security threat, but it increased the attacker\u2019s 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",
"id": "GHSA-6jqm-3c9g-pch7",
"modified": "2022-12-12T21:28:35Z",
"published": "2022-12-12T21:28:35Z",
"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"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "@cubejs-backend/api-gateway row level security bypass"
}
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.