You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tool allows publishing an existing site from the wrong project! #10376
Create two distinct Firebase projects, let's call them project-a and project-b.
In project-a, create a hosting site named my-shared-site.
Set up the firebase.json as shown in the test case with site: "my-shared-site".
Run firebase deploy --project project-a. (This succeeds and deploys to my-shared-site).
Now, switch to the other project and run firebase deploy --project project-b.
[REQUIRED] Expected behavior
The CLI should fail the deployment on step 5 or at least show a warning stating that the site my-shared-site does not belong to the active project project-b.
[REQUIRED] Actual behavior
The deployment in step 5 succeeds without any error or warning.
Because the Firebase Hosting API uses the wildcard project path projects/-/sites/my-shared-site/versions, the backend resolves the site solely by its ID (my-shared-site). Since the authenticated user has permissions on both projects, the backend allows the deployment, and the files are actually uploaded to Project A's site, even though the user explicitly targeted Project B in the command.
This leads to accidental production overwrites when developers switch project contexts but forget that they hardcoded a site ID in firebase.json.
Thanks for the thorough report and for sharing your feedback! I agree with you here, we should check if a site belongs to the corresponding project before proceeding with deployments to avoid accidental overwrites. I will route to our engineering team and mark this as reproducible.
Activity
aalej commentedon Apr 17, 2026
Thanks for the thorough report and for sharing your feedback! I agree with you here, we should check if a site belongs to the corresponding project before proceeding with deployments to avoid accidental overwrites. I will route to our engineering team and mark this as reproducible.
fix: prevent hosting deploy to site in wrong project
fix: prevent hosting deploy to site in wrong project (#10380)
kevmoo commentedon Apr 17, 2026
Who did the thingy not close this @joehan ? Was your commit message not include the fix bits?
fix: prevent hosting deploy to site in wrong project (#10380)
Prompt for ABIU runtime settings when creating a backend from the "de…
Integrate FAH Local Builds with Universal Maker (#10382)
Integrate FAH Local Builds with Universal Maker (#10382)
Prompt for ABIU runtime settings when creating a backend from the "de…
Integrate FAH Local Builds with Universal Maker (#10382)