Skip to content

fix(storage): keep the platform default bucket private - #14814

Merged
ChiragAgg5k merged 1 commit into
mainfrom
fix/platform-default-bucket
Oct 22, 2026
Merged

ChiragAgg5k merged 1 commit into
mainfrom
fix/platform-default-bucket

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

What

The platform default bucket (console project) holds CSV/JSON data exports and the files the Console stages for imports. It was created with create/read/update/delete granted to any, which is far broader than either flow needs.

  • The bucket is now created with only create("users"), so signed-in console users can still upload import files (Console: local file → console storage → createCSVImport(internalFile: true)). Reading, updating and deleting a file follow its own permissions (fileSecurity is on): the uploader gets read/update/delete("user:<id>") by default, and export files keep their read("user:<id>") grant.
  • Exports are still downloaded through the signed /push link, and imports read the file through the migration endpoints; both already load the bucket and file with authorization skipped, so neither depends on the bucket grants.
  • Existing installs: on server start, if the stored bucket permissions differ from the expected set, they are replaced with a sparse update. This runs on every deploy (self-hosted and Cloud) without an operator running migrate, so no versioned migration is needed. The bucket reads and writes at startup now run under authorization->skip() like the screenshots bucket next to it, since the document is no longer readable by any.

Compatibility

Guests can no longer upload to, list, read, update or delete files in the console project's default bucket. Console users only see files they uploaded or exports created for them.

Tests

  • E2E StorageConsoleClientTest::testConsoleDefaultBucketIsPrivate: a console user can upload to and read their file in default; a guest and a second console user cannot see it in the list, get, download, update or delete it; a guest cannot upload. Runs on CI (no local stack for this branch).

Related: appwrite-labs/cloud#6674

The platform bucket that holds data exports and console import uploads granted every permission to any role. Exports are reached through their signed download link and imports through the migration endpoints, so the bucket only needs to let console users upload; reads, updates and deletes follow per-file permissions. Existing installs get the stored permissions corrected on server start.
@luxor-code-review

luxor-code-review Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Review complete. No issues found — approved ✅.


The change bootstraps the default storage bucket at HTTP process init and extends the storage console e2e suite accordingly. Verified reviewers raised only low-confidence notes on bucket permission semantics and idempotency of the bootstrap path; nothing met the reporting threshold.

Reviewed commit: 3225fb7

@ChiragAgg5k ChiragAgg5k self-assigned this Oct 22, 2026
@ghost

ghost commented Oct 22, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The startup permission reconciliation and file-level access behavior are consistent with the intended private-bucket behavior, with no concrete defects found.

The platform default storage bucket is initialized with only an authenticated-user create grant, and startup reconciles existing bucket permissions to that set. The storage E2E test covers authenticated upload and owner access alongside guest and second-user denial cases.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 2
File Change
app/http.php Set the default bucket's create permission to users and reconcile existing bucket permissions during startup.
tests/e2e/Services/Storage/StorageConsoleClientTest.php Add coverage for default-bucket uploads and file access by the uploader, guests, and another console user.

Reviewed 3225fb7 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Tier S · Looks good to merge. Summary

@github-actions

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → fix/platform-default-bucket (after).

Metric Before After Change
🚀 Requests/sec 212.02 218.38 ⚪ +3%
⏱️ Latency P50 80.94 ms 79.5 ms ⚪ -1.8%
⏱️ Latency P95 185.2 ms 187.48 ms ⚪ +1.2%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 79.5 187.48 13,680 218.38 +2.29
Account 145.96 276.13 720 12.07 +9.15
TablesDB 77.1 142.03 7,440 120.44 -10.31
Storage 72.48 166.93 3,600 60.28 -20.57
Functions 115.96 230.54 1,920 32.89 +32.99

Top API waits (after)

API request Max wait (ms)
account.prefs.update 496.17
functions.create 418.63
account.name.update 415.57
functions.variables.update 372.32
functions.variables.create 352.69

@github-actions

Copy link
Copy Markdown

Security rules

No new WARNING or ERROR findings from security rules.

6 existing findings tracked in .semgrep/baseline.json
  • php.appwrite.guest-write-without-abuse-limit (3)
  • php.appwrite.secret-compare-timing (1)
  • php.appwrite.weak-secret-env-default (2)

Posted by Checks / Rules. Re-runs update this comment in place. Rule details and baseline: .semgrep/README.md.

@ChiragAgg5k
ChiragAgg5k merged commit 2c5a569 into main Oct 22, 2026
69 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the fix/platform-default-bucket branch October 22, 2026 16:25
ChiragAgg5k added a commit that referenced this pull request Oct 24, 2026
The console default bucket granted create, read, update and delete to any. It now only lets users create files, and file security governs the rest. Existing installs get the permissions corrected on start.

(cherry picked from commit 2c5a569)
ChiragAgg5k added a commit that referenced this pull request Oct 24, 2026
The console default bucket granted create, read, update and delete to any. It now only lets users create files, and file security governs the rest. Existing installs get the permissions corrected on start.

(cherry picked from commit 2c5a569)
ChiragAgg5k added a commit that referenced this pull request Oct 24, 2026
The console default bucket granted create, read, update and delete to any. It now only lets users create files, and file security governs the rest. Existing installs get the permissions corrected on start.

(cherry picked from commit 2c5a569)
Tapraj-Pathak pushed a commit to Tapraj-Pathak/appwrite that referenced this pull request Oct 24, 2026
…bucket

fix(storage): keep the platform default bucket private

(cherry picked from commit 2c5a569)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant