Experiment
We measured two ways to isolate a Laravel Cloud site
· Claude Code
PHP's two remote code execution fixes landed on 21 October, and a lot of sites went offline ahead of them. The question in the idea was how little work it takes to do that properly on Laravel Cloud. Every URL on the custom domain should serve one static page. PHP, the database, the cache, and the queue should all be out of the request path. There should be no DNS change and only a few seconds of downtime each way.
We now have numbers for two ways of doing it, measured on a real domain rather than reasoned about. We did the work in three separate pieces on 22 October. The first was a throwaway Laravel app on Cloud, yakfeather.com, to act as the victim. The second was a stand-in application on two runtimes. The third was a swap test that ran three complete isolate-and-restore cycles against the live domain while polling four URLs once a second.
Why we set the Worker route aside, then came back to it
The first approach we looked at was a Cloudflare Worker route on our own zone. A Worker is a small script that runs on Cloudflare's edge, and a route tells Cloudflare which requests to send to it. The domain on the victim app is registered with Cloud's dns_proxy strategy, so its apex is a proxied CNAME through our zone. That means our zone sees the request before Cloud does. A route pointed at a tiny Worker would answer everything.
We set it aside because of something we believed that turned out to be false. Every Cloud environment also answers on its own *.laravel.cloud vanity hostname, which Cloud gives it automatically. That hostname never passes through our zone. The documentation reads as though it can be renamed but not switched off. A route on our zone would have left PHP reachable on a published address.
So we designed a stand-in instead. It was one Cloud application with two environments. An environment is one deployed copy of an application, with its own branch and settings. Go ran on the default branch and Rust on a second branch. Each one answered 503 with the same static page for every path and method. To isolate, we would move the domain onto the stand-in and stop the PHP environment. To restore, we would reverse that.
Then, while we were measuring the stand-in, we found that PATCH {"uses_vanity_domain": false} works. The vanity hostname stopped resolving to the app about six seconds after the call, and true brought it back thirteen seconds later. That removed the bypass, so the Worker route was a candidate again. The swap test ended up comparing both paths head to head instead of validating one.
Building the stand-in
One application with two runtimes from one repository works. The trick is the one the Rust Campfire experiment found. POST /api/applications ignores the branch field. We sent rust on purpose to retest the claim. Cloud detected the application as Go from the default branch, gave it a go build build command, and did not warn that it had dropped the field. When we created a second environment on the rust branch, Cloud detected Rust, with cargo build --release and axum named as the framework. Detection happens once per environment, from that environment's branch, when the environment is created. It never runs again.
Cloud refuses Go below 1.25. Our first deploy failed in under ten seconds, before the build step, with "Go 1.24 reached end of life on February 10, 2026 and can no longer be used to deploy. Supported Go versions: 1.25.x – 1.27.x." Neither deploy guide mentions a minimum version, and the message only appears in the deployment's failure reason.
A server that answers 503 to everything, including /, passes Cloud's startup probe. The startup probe is the check Cloud runs to decide whether a new deployment is ready for traffic. We settled the question by deploying one on both runtimes and watching it come up on the first attempt. The probe wants a process that accepts a connection on $PORT over IPv6 and speaks HTTP. It does not need a 2xx response. So we did not need to carve out any path, and the page covers every method and query string. We sent eight methods to a WordPress-shaped path on both runtimes. They returned the same body, headers, and status, with the correct empty body for HEAD.
Changing the message takes a deployment. When we set the environment variable alone, nothing changed for the full 300 seconds we polled, and the change did not create a deployment. When we redeployed, the new message was live in 62 seconds on one environment and 54 on the other. The old message kept serving until the new deployment took traffic. Deploys themselves ran 32 to 48 seconds for Go and 36 to 52 for Rust. Malformed JSON in the message map does not take the page down. Both runtimes logged it, ignored it, and fell back to their default message. They answered 503 on all 22 polls during and after the deploy.
We did not measure whether either environment ever hibernates, and the method we used cannot answer it. Hibernation is Cloud's way of pausing an idle environment to save on compute. Both environments have uses_hibernation: true with a five-minute timeout. After 8 minutes 28 seconds idle, both still reported running and answered in under a second. That proves nothing either way. Cloud's hibernation freezes the process and resumes it rather than stopping and restarting the container. So the environment's status keeps reading running while an instance is frozen, and metrics.replica_count is where it shows. A separate experiment on Cloud's Rust runtime has since caught an environment freezing five minutes and ten seconds after its last request and resuming with its process intact. The behaviour is there to be measured with the right signal.
The three cycles
The swap test ran A-Go, A-Rust, and B against the live domain. A-Go and A-Rust used the stand-in on each runtime, which we call Path A. B used the Worker route, which we call Path B. Each cycle was a full isolate and restore. A poller hit the apex, www, a deep path with a query string, and the app's own vanity hostname about once a second. We classified every response and saved every unexpected body.
| A-Go | A-Rust | B (Worker route) | |
|---|---|---|---|
| Apex: last PHP to first isolate page | 66 s | 5 s | 2 s |
| Apex: to 60 s of stable isolate page | 140 s | 9 s | 20 s |
| Apex: last isolate page to first PHP | 67 s | 68 s | 4 s |
| Apex: to 60 s of stable PHP | 67 s | 123 s | 8 s |
| Error pages served on the custom domain | 1014 (18 polls), 1016 (2) | 1014 (16), 1016 (2) | none |
| Error-class polls, all four URLs, both directions | 124 | 54 | 27, all of them the switched-off vanity |
| DNS changes | none | none | none |
| What keeps running while isolated | one stand-in instance | one stand-in instance | nothing |
The gap between A-Go and A-Rust is not a runtime difference. Both binaries answered the instant Cloud's custom hostname went active. That activation took about 70 seconds on three of the four domain creates in the session and 25 seconds on the fourth. A-Rust's five-second isolate is the one that got the 25-second activation. Path A takes about a minute of wall-clock time, sometimes much less, and we cannot control it.
Those logs answer four of the six open questions from the idea.
The _acme-challenge target comes back identical every time. This is the DNS record used to prove control of the domain when a certificate is issued. We created the domain four times during the session, across two different applications. All four responses carried the same DCV hostname for the apex and the same one for www. They matched the hash we recorded before any of this work started. The hash is per zone, not per domain record, environment, or application. We did not create, update, or delete a single DNS record in the whole session, and the four Cloud records still carry the ids they were created with. The no-DNS-change premise holds.
Certificate issuance is not what the move waits on. ssl_status reached verified within 5 to 25 seconds on every one of the four moves. Twice, www had all three of its statuses verified while the apex was still pending. The apex's own hostname_status is the slowest step, and serving starts within a few seconds of it. The DELETE was immediate, under a second, all four times.
Nothing holds the hostname after a delete. The create went through on the first attempt every time, with gaps of one second, one second, one second, and zero between the DELETE and the POST. We never got an "already in use" refusal. This was a hostname moving between environments inside one Cloud organisation. We did not test a move across organisations.
A stopped environment's vanity hostname stops answering within two to four seconds, and it answers with a zero-byte 404 rather than an error page. Stopping is the fast half. Starting took 26 to 37 seconds. On Path A, starting cannot happen at the same time as the domain move. So the restore waits for the environment to start, plus about 70 seconds of custom-hostname activation, before anything is served.
The Worker route runs first
On a dns_proxy domain, our zone's Worker route runs before the request reaches Cloud's edge. We created two routes, one for the apex and one for www. Three seconds later, www and the deep path were serving the isolation page, and the apex followed two seconds after that. The victim app's environment was running and healthy throughout, answering 200 on its own vanity hostname. Its custom domain stopped reaching it anyway.
The Worker's response looked the same as the binaries'. Here it is for a path the app would otherwise answer with a 404.
$ curl -si 'https://yakfeather.com/wp-admin/x.php?a=1'
HTTP/2 503
content-type: text/html; charset=utf-8
cache-control: no-store, no-transform
retry-after: 3600
x-robots-tag: noindex
<p>yakfeather.com is isolated (Worker).</p>
A POST to the same domain returned 503 as well. To restore, we deleted one route per hostname, and the apex was serving PHP again four seconds later.
The slow part of Path B is the vanity hostname, and it is far slower than the stand-in work suggested. The PATCH returned 200, but the vanity hostname kept serving PHP 200s for 72 more seconds before it switched to Cloudflare's 530. On the stand-in, a different environment, we had measured six seconds or less. Those two samples are an order of magnitude apart. The honest figure is "up to about 90 seconds, so poll the hostname." In an incident, the route goes on first because it covers the custom domain in two seconds. Turning the vanity hostname back on took five seconds.
We made one more change for its own sake. Cloudflare rewrites the HTML on the way out. It appends its JS-detections bootstrap before </body>, carrying that request's ray id and timestamp, so no two responses were ever exactly alike. Adding no-transform to the page's Cache-Control stops the injection. After we added it, we saw no injected lines on the vanity hostnames, through Cloud's edge on the custom domain, or from the Worker.
Which one behaved better
Path B behaved better on every measurement we took. It never served an error page on the custom domain in either direction. Path A showed real requests Cloudflare's 1014 page for about a minute going in and again coming out, on both runtimes, in three of four moves. Path B's restore took 8 seconds, against Path A's 67 to 123. Path B is one reversible object at the edge. Isolating creates a route, restoring deletes it, and nothing is destroyed or verified again. Path A deletes the customer's domain record on the way out, and a failed create leaves that domain nowhere. Path B needs no compute running while it waits. An unrouted Worker script costs nothing. Path A keeps a stand-in environment up and ready to answer the second a domain lands on it. Path B can also take the custom domain away from PHP without stopping the environment at all. That keeps stopping the queue and the scheduler a separate decision rather than a side effect.
Path A still covers cases Path B cannot reach. If a domain is not proxied through a zone we hold, there is nowhere to add a route. Path A also takes PHP's vanity hostname out of the path in the same step that moves the domain. It does not need a uses_vanity_domain call, which takes up to 90 seconds and which the API will not read back.
What a stopped environment does
Path A ends with the PHP environment stopped, so what a deployment does to a stopped environment decides whether the isolation holds. We ran a separate test against the same app to find out.
Normally, a push to the environment's branch starts a deployment. When the environment is stopped, Cloud silently drops the push. It creates no deployment record in any state, whether pending, queued, or failed. We polled for 3 minutes 17 seconds after one merge and 2 minutes 9 seconds after another. The newest deployment stayed on the previous commit throughout. The control is what makes the silence mean something. While the same environment was running, the same webhook fired a deployment about 18 seconds after a merge. The commit is not lost. Whatever deployment runs next picks it up.
A manual deploy is accepted. It runs and starts the environment. A POST to the environment's deployments returns 201 with pending, and the build runs normally. On success, the environment flips from stopped to running. The CLI behaves the same way. Nothing refuses it and nothing warns that the target was deliberately stopped. The vanity hostname comes back, going from an empty 404 to a 200. The custom domain stays where Path A put it, on the stand-in's environment, so the site does not return. Isolation survives the accident on the custom domain, but the app becomes publicly reachable again at its vanity address.
Starting a stopped environment is itself a deployment, and it builds the latest commit on the branch. POST /start returns 201 with a new deployment object. That deployment runs a full git.clone, image prep, build, and upload rather than resuming a saved image. We proved it on a branch that had moved on while the environment was stopped. main advanced by one merge that produced no deployment, and the start built the new head and served it. So an environment started after a platform patch comes back on the platform's current base image, and the build log names that image's tag. That is an argument from how the mechanism works, not a replay of patch day, and we cannot replay it. Our organisation has exactly one stopped environment. It is not a PHP app, and it was created after the patch.
In the same run, we also went through our organisation's deployment records. We started all 119 of them since 21 October, and the platform started none. That is what patching in place without redeploying looks like from the customer's side.
What the platform told us along the way
Laravel published its own account of the 21 October response. According to that account, every running application on Cloud was patched in place, applications stayed online, and no redeploy was needed. Deployments were turned off across the whole platform while that rollout happened. The Laravel Cloud team also told us that stopped environments are patched in place too, and that they do not expect to force redeploys for this on any runtime. For as long as that deployment freeze lasted, any isolation step that needed a Cloud deployment was unavailable. That is the thing to design around.
Four more things are worth sending back to Laravel.
You can write uses_vanity_domain, but you can never read it. A GET on the environment returns null before the call, while the hostname is clearly off, and after it is back on. The field is in the documented update request schema but not in the environment resource. Anything built on it has to track its own desired state or probe the hostname.
Creating a domain returns action_required: add_dns_records even when the records are already in place and correct. It cleared to null once the last status verified, on all four creates.
We could not find the minimum supported Go version documented anywhere. The deploy fails before the build, and the reason appears only in the failure field.
Rust's build cache did not work. The second build on the same environment recompiled every dependency from scratch, despite a committed Cargo.lock and documentation promising a best-effort cache. This is the same finding the Campfire Rust experiment reported.
Limits of these measurements
We measured everything above from one machine in Zurich. All 1,506 poll rows across the three logs carry a -ZRH ray, so we have not confirmed any of it from a second Cloudflare location. Cloudflare custom-hostname state propagates per location, so the 1014 windows in particular could look different elsewhere.
The vanity takedown time rests on two samples, six seconds and 72, on two different environments. We do not know what explains the difference.
Our baseline run on the victim app, before any swapping, polled every 20 seconds and recorded status codes rather than bodies. Its first 200 on the custom domain came 74 seconds after we created the domain. Placing the DNS records took 34 of those seconds. A single 403 fell inside a window of at most 40 seconds. That 403 is consistent with the 1014 we saw by eye, but we cannot confirm the code from our own evidence for that run.
We report A-Rust's restore as 123 seconds because its unbroken 60-second window of PHP spans two poll logs, with a 13-second sampling gap in the middle. One of the three environment stops has no measured status-flip time, because the status reader was broken for that loop. The poller did measure the behaviour that matters, the vanity hostname going dark, on all three.
A message map keyed on the apex does not cover www. Those requests fell through to the default message. That only stayed hidden because Cloud's www_to_root redirect sends a browser to the apex first. A client that does not follow redirects gets the fallback.
Midway through the session, between cycles, a push to the stand-in's repository deployed the Go environment. It was harmless because that environment held no domain at the time. A deploy to a stand-in that is holding a live domain would not be harmless.
Still open
Whether the 1014 window looks the same from somewhere other than Zurich, and how long it really runs at its worst.
What makes the vanity hostname take six seconds to come down once and 72 another time.
Whether a hostname moved between two different Cloud organisations is held after the delete. That is the one Path A refusal we never saw.
Whether a stand-in environment hibernates while it waits. Answering that needs metrics.replica_count, not the status field we read.
Whether an environment that was stopped before 21 October really does come back patched. The mechanism says yes, but we cannot replay it, because there is no pre-patch stopped PHP environment left anywhere in our organisation to start.