Repository navigation
fix(deployment): isolate Local build workers from sibling project trees - #14098
Merged
Merged
Conversation
The Local storage strategy mounted the entire shared builds volume into
every build container. Mount only app-{projectId} via the orchestrator
Volume.subPath so one project's build cannot list or write another's
tree, while buildPath, cachePath, and deviceForBuilds stay unchanged.
Co-authored-by: Jake Barnby <[email protected]>
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
Co-authored-by: Jake Barnby <[email protected]>
abnegate
marked this pull request as ready for review
October 5, 2026 05:15
🟢 Tier S · Ready to merge
Local build jobs now mount only the current project's subdirectory of the builds volume, while retaining the existing output and cache paths. The change creates the project directory before submission, updates the volume documentation, and adds unit coverage for project-specific mount payloads.
📂 Walkthrough · 3
Reviewed |
abnegate
added a commit
that referenced
this pull request
Oct 5, 2026
Bring in main 537fa27 (#14097 console membership role changes and invitations need the team owner or an API key; #14098 Local build workers attach only the project's app-<projectId> subdirectory of the builds volume) so the PR is mergeable again. Conflicts: - tests/unit/Deployment/DeploymentsTest.php: kept both sides. Imports are the union (orchestrator Jobs/exceptions for the submission-recovery tests plus Model\Volume for the volume-isolation tests). The branch's submission tests and Memory-adapter helpers stay, followed by main's two Local build mount tests and their withLocalBuilds() helper; buildPayload() takes main's projectId parameter (auto-merged). Adaptations: none. Main's changes touch no database APIs; composer.json and composer.lock are unchanged, database stays at e8cb1af9a. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes Help Scout report HS 1468629 Finding 2 (reporter: Kikoichi): on
_APP_STORAGE_DEVICE=Local,Deployments::storage()attached the entire sharedappwrite-buildsvolume (_APP_BUILDS_VOLUME) atAPP_STORAGE_BUILDS(/storage/builds) to every project's build worker. Tenant build commands then ran with read/write access to every other project's/storage/builds/app-<projectId>/<deploymentId>/artifacts.This is a Docker/Kubernetes volume-mount scope issue (CWE-653), not CVE-2026-89036 (tar argument injection, already fixed). Remote/S3 is unchanged: that branch mounts no volume and copies artifacts through the sidecar.
Isolation contract
DeviceType::Local, the worker receives one named-volume mount: source_APP_BUILDS_VOLUME,subPathapp-{projectId}, path$device->getRoot()(/storage/builds/app-{projectId}).app-{otherProject}trees are not on that mount. A path such as/storage/builds/app-otheris not under the attached path, so the worker cannot list or write another project's build tree through the shared volume.OPEN_RUNTIMES_BUILD_OUTPUT_DIR,OPEN_RUNTIMES_BUILD_CACHE_ARTIFACT,buildPath(),cachePath(), anddeviceForBuildsstay the same Appwrite-side paths. Package-manager cache remains shared across a resource's deployments inside the same project.Subpathexists (the orchestrator mapsVolume.subPathto DockerVolumeOptions.Subpath/ KubernetesVolumeMount.subPathand does not create volumes).Finding 3 (same report, not in this PR)
Blind SSRF on Migrations report/create. Appwrite and Supabase
report/createalready validate the source endpoint withPublicHostname(resolve + private/reserved-range deny). NHost/Firebase do not take a free-form URL. Timeouts / extra IP-pin on the outbound client are a separate change.Test Plan
tests/unit/Deployment/DeploymentsTest.phptestLocalBuildMountsOnlyTheProjectDirectory— Local payload mountsapp-{projectId}(notAPP_STORAGE_BUILDS) and keeps output/cache/buildPath aligned.testLocalBuildMountCannotReachSiblingProject— a siblingapp-project2path is not under project1's mount; two projects get distinctsubPaths.composer lint/composer formaton the touched PHP files when the environment has PHP.docker compose exec appwrite test tests/unit/Deployment/(PHP/Docker were not available in this agent environment).Related PRs and Issues
Checklist