Repository navigation
Conversation
POST /api/admin/bake accepted any deployment whose server is in the platform's Hetzner project. Quick Deploy buyers' servers live there too, and sanitizing wipes the box (SSH host keys, .env, data volumes) before snapshotting it, so a mistyped deployment_id could wreck a buyer's server and put its data into a published snapshot. - the deployment must belong to the caller (403 otherwise); a service token (admin_service) owns no box and is refused. The bake harness calls with the CLI token of the admin who deployed the box, so it is unaffected - a deployment with a Managed-server usage row (Quick Deploy) is refused (409), even when the caller made it - the health probe no longer follows redirects: the box chooses where they point, and the backend would call that address for it Tests: tests/admin_bake.rs (another user's box, a Quick Deploy server, admin_service; the old code accepted the first with 202) and a unit test for the redirect, both written failing first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Security fix for
POST /api/admin/bake, found in a review on 2026-10-26.Problem
deployment_idwas accepted for any deployment whose server is in the platform's Hetzner project. Quick Deploy buyers' servers live in the same project (124705)..envand resets the data volumes, then the box is snapshotted. A mistyped id, or a leakedADMIN_JWT_SECRET, could wreck a paying customer's server and put their data into a snapshot served to later buyers.Change
admin_servicetokens (User.id = "admin_service") own no box and are refused.bake_pipeline.pycalls with the CLI token of the admin who deployed the build box, so it is unaffected.managed_usagerow (Quick Deploy) is refused with 409, even when the caller made it.probe_health(moved tohelpers/bake_job.rs) usesredirect::Policy::none(); a 3xx now fails the health check.Tests, written failing first:
tests/admin_bake.rs, now as agroup_adminuser who owns the box:admin_service;the_health_probe_does_not_follow_a_redirect_off_the_box.--lib(2303),quick_deploy_server_type,migration_boot_contract.clippyreports nothing in the changed files.Note for Stage 5. An admin-ui "Bake" button must call with the admin's own token, not an
admin_serviceJWT.Merging with #310. Both PRs touch
src/routes/admin_bake.rs, in different hunks.🤖 Generated with Claude Code