Repository navigation
fix: backport VCS, functions and outbound security fixes to 1.9.x - #14911
Conversation
|
Review complete. 🟠 1 high · 🟡 2 medium 💬 Inline comments (3)
🧹 Nitpicks (4) — 🟢 4 low
This change reworks how preview executions isolate caller credentials and how builds resolve the user-specified root directory inside cloned repositories. The header-sanitization work strips
Reviewed commit: 915dd05 |
🟢 Tier S · Ready to mergeThis backport adds signed, user-bound VCS installation state, repository-root and preview-domain protections, request-header and cookie filtering, and migration-file ownership checks. It also validates and pins outbound SMTP and migration connections, adds attachment-scope checks, and updates deleted-project worker handling and provider response filtering. The SMTP private-host e2e cases now provide a password when changing servers so they exercise the host-validation behavior. Latest changes: The SMTP private-host e2e cases now pass an explicit password for the server change, keeping the test focused on rejecting the private host under the password-preservation rule.
📂 Walkthrough · 10
Reviewed the commits since |
✨ Benchmark resultsComparing 1.9.x (before) to fix/1.9.x-security-compute (after). Before
After
Delta
Top API waits
|
There was a problem hiding this comment.
This PR hardens function/site preview isolation and build path confinement — stripping session cookies/headers before user code runs, confining rootDirectory to repository paths, replacing VCS preview-domain hashing, and signing GitHub OAuth state — but introduces a PHP 8.4-only function on the PHP 8.3 runtime and a few compatibility gaps.
Key findings
- 🟠
\array_anyrequires PHP 8.4; project targets PHP 8.3 — general.php:266 - 🟡 Legacy stored root directories with
..now fail builds — Builds.php:421 - 🟡
x-fallback-cookiesheader leaks session secrets to user code — general.php:302
2e896d8 to
f5b4523
Compare
f5b4523 to
7943c1b
Compare
🔄 PHP-Retry SummaryFlaky tests detected across commits: Commit
|
| Test | Retries | Total Time | Details |
|---|---|---|---|
TablesDBCustomServerTest::testOrQueries |
1 | 689ms | Logs |
TablesDBTransactionsConsoleClientTest::testBulkDeleteMatchingUpdatedDocuments |
1 | 240.40s | Logs |
Commit ffb81c9 - 1 flaky test
| Test | Retries | Total Time | Details |
|---|---|---|---|
TablesDBACIDTest::testDurability |
1 | 240.26s | Logs |
Commit bb4f857 - 1 flaky test
| Test | Retries | Total Time | Details |
|---|---|---|---|
RealtimeConsoleClientTest::testIndexesTablesAPI |
1 | 332ms | Logs |
Commit 61362ab - 1 flaky test
| Test | Retries | Total Time | Details |
|---|---|---|---|
FunctionsServerTest::testCreateExecution |
1 | 39ms | Logs |
Commit 8547818 - 1 flaky test
| Test | Retries | Total Time | Details |
|---|---|---|---|
LegacyCustomServerTest::testCreatedAfter |
1 | 240.54s | Logs |
Note: Flaky test results are tracked for the last 5 commits
7943c1b to
6963aa3
Compare
6963aa3 to
a185a4d
Compare
|
@hansi-codes review |
9aa91c5 to
ffb81c9
Compare
|
@hansi-codes review |
Ported the root directory validation and the builds worker confinement. The build artifact checks target the orchestrator build path, which 1.9.x does not have. (cherry picked from commit e2c3e34)
Ported the preview rule ownership check and the wider, separated branch domain hash (existing previews keep their legacy domain). The jobs worker cache key and lock changes target a worker 1.9.x does not have. The ownership tests live in the existing BranchDomainTest because the rule activation helper does not exist on 1.9.x. (cherry picked from commit 9fc6d27)
Ported the API and worker validation of the NHost subdomain, region and database name. 1.9.x uses the vendored utopia-php/migration 1.14 and utopia-php/validators, so the Label validator and the NHost database address pinning need a library release; the shape check uses Text allow-lists instead. (cherry picked from commit 45b90fa)
…MTP (backport #14811) Project SMTP and messaging SMTP provider hosts are checked against public addresses on save, on the SMTP test endpoint, and again by the mails and messaging workers before each send. Project SMTP verification dials the checked address of a single server and no longer echoes the server reply. Adds _APP_ALLOWED_INTERNAL_ADDRESSES (introduced in 1.9.10) so an internal relay can still be allowed. Pinning worker connections to the checked address needs the messaging library's SMTP addresses option, which 1.9.x's vendored utopia-php/messaging does not have. (cherry picked from commit 1c3636d)
ffb81c9 to
bb4f857
Compare
|
@hansi-codes review |
The findings that requested changes are resolved. See the summary comment for what is still open.
|
@hansi-codes review |
|
@hansi-codes review |
…ompute # Conflicts: # src/Appwrite/Utopia/Request.php # tests/e2e/Services/Sites/SitesCustomServerTest.php
|
@hansi-codes review |
1.9.x now requires the password again whenever the SMTP host changes (backport of #14795), so the private-host regression test passes it.
|
@hansi-codes review |
Backports security fixes from
mainto1.9.x. One commit per PR. No schema changes or migrations.vcs.readuploaderIdin metadata, which the internal import ownership check needsLabelvalidator and NHost database address pinning live in utopia-php/validators and utopia-php/migration and need a library release_APP_ALLOWED_INTERNAL_ADDRESSES(1.9.10) to allow an internal relay. The vendored messaging library has no address option, so an app-side SMTP adapter dials each server on its checked address&in the redirect is left as written because 1.9.x's plain-text email part is the stripped HTML, so&would break its linksProvidermodel filter strips secrets; identifiers stay readable withproviders.readRelated: appwrite-labs/cloud#6671