Describe the Bug
AppSocket.updateData() immediately updates records containing id and one of these fields:
deleted, closed, public, end, disable, enabled.
This early return bypasses the authorization logic that follows it. A user may therefore update a record they do not own by submitting its ID with one of these fields.
Reproducibilty
Steps to Reproduce the Behavior
- Sign in as a non-admin user.
- Obtain the ID of a record owned by another user.
- Emit
appDataUpdate with that ID and a special field, for example:
{
"table": "document",
"data": {
"id": 123,
"deleted": true
}
}
- Observe that
updateById() is called before the ownership check.
Expected Behavior
Every update is authorized before changing the record. Partial updates remain supported, and required-field validation does not incorrectly reject them.
Models beforeUpdate hooks can be a possible way to handle this, which may contain conditional runs for those special keys updates only.
Actual Behavior
Updates containing one of the special fields return early and bypass the authorization check.
Screenshots
Not applicable.
Additional Information
Relevant file: backend/webserver/sockets/app.js, AppSocket.updateData().
Acceptance criteria:
Describe the Bug
AppSocket.updateData()immediately updates records containingidand one of these fields:deleted,closed,public,end,disable,enabled.This early return bypasses the authorization logic that follows it. A user may therefore update a record they do not own by submitting its ID with one of these fields.
Reproducibilty
Steps to Reproduce the Behavior
appDataUpdatewith that ID and a special field, for example:{ "table": "document", "data": { "id": 123, "deleted": true } }updateById()is called before the ownership check.Expected Behavior
Every update is authorized before changing the record. Partial updates remain supported, and required-field validation does not incorrectly reject them.
Models
beforeUpdatehooks can be a possible way to handle this, which may contain conditional runs for those special keys updates only.Actual Behavior
Updates containing one of the special fields return early and bypass the authorization check.
Screenshots
Not applicable.
Additional Information
Relevant file:
backend/webserver/sockets/app.js,AppSocket.updateData().Acceptance criteria: