Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS05NzIyLTlqNjctdmpjcs4ABAFl

Improper Authorization in Select Permissions

Due to the order in which permissions were processed, some statements, filters and computations could lead to leaking field values or record contents to users without the required permissions. This behavior could be triggered in different scenarios:

Impact

Clients that were authorized by table permissions to execute SELECT statements for a table but were not authorized by field permissions to run SELECT queries for a specific field could still have been able to gain knowledge of the value of that field. Additionally, clients that were authorized to execute UPDATE or DELETE statements for a table but not authorized to execute SELECT statements for the same table may have been able to gain knowledge of the contents of records in that table. This could only be exploited by users who were already authorized to execute queries on the database with the affected table or field.

Due to its relationship with table and field permissions, which apply mainly to record users rather than system users, this issue mostly affects users relying on SurrealDB as a backend-as-a-service rather than SurrealDB as a traditional database backend.

Patches

The behavior when evaluating table or field permissions and filtering records or fields as a result of those evaluations has been improved to consider permissions before any changes to the document have been made and, when relevant, permissions after changes to the document have taken place. When a user is unauthorized to view record contents and field values by permissions, the returned documents will behave as if the record or field did not exist in order to prevent leaking any information.

Workarounds

Users affected by this issue and unable to update should not rely on the authorization provided by field permissions when it comes to the SELECT permission. Instead, read access to fields in affected versions should be restricted at the table level. When allowing the UPDATE or DELETE operations for records via table permissions, users should not rely of the authorization provided by the SELECT permission. Instead, users should not allow clients to UPDATE or DELETE records that they should not be able to view.

Permalink: https://github.com/advisories/GHSA-9722-9j67-vjcr
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS05NzIyLTlqNjctdmpjcs4ABAFl
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: 7 days ago
Updated: 7 days ago


CVSS Score: 6.5
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

Identifiers: GHSA-9722-9j67-vjcr
References: Repository: https://github.com/surrealdb/surrealdb
Blast Radius: 14.3

Affected Packages

cargo:surrealdb-core
Dependent packages: 4
Dependent repositories: 0
Downloads: 140,224 total
Affected Version Ranges: < 2.0.4
Fixed in: 2.0.4
All affected versions: 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.3.1, 1.3.2, 1.4.0, 1.4.1, 1.4.2, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 2.0.0, 2.0.1, 2.0.2, 2.0.3
All unaffected versions: 2.0.4
cargo:surrealdb
Dependent packages: 42
Dependent repositories: 158
Downloads: 206,413 total
Affected Version Ranges: < 2.0.4
Fixed in: 2.0.4
All affected versions: 1.0.0, 1.0.1, 1.0.2, 1.1.0, 1.1.1, 1.2.0, 1.2.2, 1.3.0, 1.3.1, 1.4.0, 1.4.2, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 2.0.0, 2.0.1, 2.0.2, 2.0.3
All unaffected versions: 2.0.4