Vercel environment variables exposed: what to rotate
If your Vercel project held a key in an environment variable that was not marked sensitive, replace that key at its provider now. Use this order: database, payments, AI providers, email. Then update Vercel, redeploy, and mark the new value as a Secret. Do this even if Vercel did not contact you.
This guide shows what Vercel says happened and how to find your exposed keys. It also shows how to replace them in a safe order and how to stop this problem in the future.
What did Vercel say happened?
Vercel published a bulletin about the April 2026 security incident. These are the facts from that bulletin.
- Vercel “identified a security incident that involved unauthorized access to certain internal Vercel systems.”
- The incident “originated with a compromise of Context.ai, a third-party AI tool used by a Vercel employee.”
- The attacker took over the employee’s Google Workspace account, then the employee’s Vercel account.
- The attacker could “enumerate and decrypt non-sensitive environment variables.” These are variables that decrypt to plaintext.
- Vercel contacted a limited subset of customers whose keys it confirmed as compromised.
- Later, Vercel found a small number of additional compromised accounts.
- Vercel found other accounts with signs of compromise that “appear to be separate” from this incident.
- Vercel states that none of the npm packages that it published were compromised.
- On 16 October 2026, Vercel stated that all remediation actions are complete and that the incident is closed.
The bulletin does not give the number of affected customers. It also does not list which variables the attacker read. You cannot learn this from the bulletin, so you must assume that any non-sensitive variable was readable.
The bulletin separates this incident from some other account compromises. Vercel says the other cases do not appear to come from Vercel systems. Read the bulletin for the exact words, because Vercel updated it several times in April.
GitGuardian gives the same advice for customers that Vercel did not contact. Investigate each non-sensitive variable, replace the key at the provider, and then redeploy.
Why must I rotate if Vercel did not contact me?
Vercel does not say that it found every case. It says that it contacted customers with confirmed compromise. A variable that the attacker read, but did not use yet, is not a confirmed case.
A key that the attacker holds is a key that can work later. The attacker does not need to hurry. You do not get a signal when the attacker uses a database key to read data. The only safe action is to replace the key.
Vercel gives this advice to all customers:
- Review and replace non-sensitive environment variables, with priority.
- Mark keys as sensitive variables.
- Enable multi-factor authentication.
- Check the activity log.
- Check recent deployments, and delete deployments that you do not expect.
- Set Deployment Protection to Standard at a minimum.
- Replace Deployment Protection bypass tokens, if you set them.
Caution: Do not delete a project or an account to solve this problem. Vercel states that deletion is not enough to remove the risk. Rotate the keys first.
How do I find every exposed key?
Make a list before you change anything. Without a list, you will miss one key.
- Open the Vercel dashboard.
- Open each project, then Settings, then Environment Variables.
- Open the team Environment Variables page for shared variables.
- Write each variable name, its environments, and its type.
- Mark each variable that holds a real key.
Variables with a Config type, or old non-sensitive variables, were readable. Variables with a Secret type, or old Sensitive variables, are write-only after you save them.
You can also list names with the CLI. The CLI shows names and environments, not values:
vercel env ls
vercel env ls production
Run the command in each linked project folder. Use vercel link first if the folder is not linked.
Check these places for keys, because people forget them:
- Preview and Development environments. They often hold a copy of the production key.
- Variables from integrations, such as Supabase or Upstash.
- Team-level shared variables that many projects use.
- Variables with a
NEXT_PUBLIC_prefix that hold a real key by mistake. - Deployment Protection bypass tokens.
To find which keys are valid, you can scan the values with a secret scanner. GitGuardian describes a method with ggshield in its post. If you pull values to a file, delete the file after the scan. Do not commit it.
Use the token leak checker to see if one of your keys is in a public bundle or file.
In what order do I rotate the keys?
Rotate the keys with the most damage potential first. Use this order.
- Database. A database key gives direct access to user data.
- Auth and signing keys. These include JWT secrets and session secrets.
- Payments. A Stripe secret key can move money.
- AI providers. An OpenAI or Anthropic key spends your money.
- Email and messaging. A Resend or Twilio key sends messages in your name.
- Everything else. Storage, analytics, and webhook keys.
Replace the key at the provider first. Then update Vercel. This is the order that Vercel and GitGuardian both give. If you only change the value in Vercel, the old key still works for the attacker.
Vercel documents a safe order to avoid downtime. Create the new key and keep the old key active. Update the variable in Vercel. Redeploy. Test. Then delete the old key.
If you think the attacker already used a key, break this order. Delete the old key at once. A short outage is better than more abuse.
How do I rotate keys at each provider?
How do I rotate the database keys?
For Supabase, open the project Settings. Create a new service_role or secret key. Reset the database password if the connection string was in Vercel. Reset the JWT secret only if you must, because it signs out all users. Read the Supabase service role key guide for the full steps.
If you use the Vercel Supabase integration, Vercel documents a way to rotate from the integration page. Open the integration, then the resource, then Settings, then Secure This Resource. Select Rotate Secrets. Then redeploy the linked project.
For Upstash Redis, open the Upstash console, reset the password of the database, and copy the new URL and token. For Neon or Postgres, reset the role password and update DATABASE_URL.
How do I rotate Stripe keys?
- Open the Stripe Dashboard.
- Go to Developers, then API keys.
- Select Roll key for the secret key.
- Set an expiry for the old key, for example 24 hours.
- Copy the new key to Vercel.
- Redeploy and test a payment.
Also roll the webhook signing secret. Open the webhook endpoint in the Dashboard and roll it. Update STRIPE_WEBHOOK_SECRET. A leaked signing secret lets an attacker send fake events to your app.
How do I rotate AI and email keys?
For OpenAI, open the API keys page. Create a new key. Update Vercel. Delete the old key. Set a monthly spend limit on the new key. Check the usage page for spikes. The OpenAI bill spike guide lists what to look for.
For Resend, create a new API key, update Vercel, and delete the old key. Check the sent email log for messages that you did not send.
How do I update Vercel and redeploy?
Update each variable after you create the new key. Use the dashboard or the CLI.
- Open Settings, then Environment Variables.
- Click Edit from the three-dot menu on the variable.
- Paste the new key.
- Select the environments that need it.
- Set the type to Secret.
- Click Save.
With the CLI, use the --sensitive flag. Vercel stores the value as a Secret:
vercel env rm OPENAI_API_KEY production
vercel env add OPENAI_API_KEY production --sensitive
The add command asks for the value. Paste the new key at the prompt.
A change to a variable applies only to new deployments. Redeploy each project after the change. Open Deployments, select the latest production deployment, and select Redeploy.
Old deployments keep the old value. Vercel states that an old deployment URL still uses the old key. Delete old deployments that you do not need. After you delete the old key at the provider, an old deployment that needs it will fail.
Warning: Do not delete the old key at the provider before every project has redeployed. A project that you missed will fail.
How do I use the sensitive flag correctly?
The names changed in the Vercel interface. The newer types are Config and Secret. Old sensitive variables now show as Secret. A Secret is write-only after you save it. You can provide a new value, but you cannot read the old value.
Use Secret for passwords, API keys, tokens, and signing keys. Use Config for values that you need to read again, such as a public URL.
These facts matter:
- You cannot convert a saved Secret back to Config in place.
- You cannot change the key name of a Secret after you save it.
- Vercel hides a Secret value in build logs when the value has 32 characters or more.
- Variables that an integration created cannot change to Secret from the list. You must disconnect, rotate, and reconnect the resource with Sensitive on.
The flag does not fix an old leak. It only protects the new value from being read in the future. Replace the key first, then set the flag on the new value.
Read the Vercel documentation on Config and Secret variables for the current rules.
How do I keep production keys out of Preview?
Preview deployments run code from every branch. Many teams copy the production key to Preview. This means a branch from any contributor can use your production database.
- Open each variable that has the Preview environment.
- Check if the Preview value equals the Production value.
- Create a separate test database and test keys.
- Give Preview its own value.
- Set the Preview value as a Secret.
Vercel has a team policy named Separate Production Secret Values. Owners can enable Require Separate Values in the Security settings. Each Secret must then use a different value in Production than in Preview and Development.
Also lock the preview URLs. Read the guide for open preview deployments for the steps.
How do I read the activity log?
The activity log shows account and project events. Use it to look for actions that you did not start. Vercel states that the Activity Log is available on all plans.
- Open the Vercel dashboard.
- Open Activity for the team.
- Look back to the start of April 2026.
- Look for new tokens, new team members, and changed environment variables.
- Look for deployments that you did not start.
- Look for changes to Deployment Protection settings.
You can also use the CLI:
vercel activity
Run vercel activity --help for the filter flags in your CLI version.
Then check the Deployments list. Delete any deployment that you do not recognize. Check the Git integration for connected repositories that you do not know. Review access tokens under your account settings and delete tokens that you do not use.
Check the provider logs as well. The Vercel log does not show how an attacker used a stolen database key. Look at the Supabase API logs, the Stripe request logs, and the OpenAI usage page. Look for unknown IP addresses from April 2026 to now.
How do I stop this in the future?
Assume that a platform can leak a variable. Reduce what the leak can do.
- Mark every new key as a Secret.
- Give each key the lowest rights that the feature needs.
- Use different keys for Production and Preview.
- Set spend limits on AI provider keys.
- Enable multi-factor authentication on Vercel and on every provider.
- Review the team members and tokens each quarter.
- Set Deployment Protection to at least Standard.
The Vercel security checklist and the Vercel safety page cover more settings. The article on the integration layer explains why third-party tools are a growing risk. The root cause in this incident was a third-party AI tool, not the Vercel product itself.
When should I get help?
Get help from a security engineer if one of these is true:
- The logs show use of a key from an address that you do not know.
- The database held personal data, payment data, or health data.
- You cannot tell which keys were in Vercel.
- You see charges, emails, or deployments that you did not start.
- You must tell users or a regulator.
Keep the activity log, the provider logs, and a list of the times when you replaced each key.
Common questions
Was my Vercel account part of the April 2026 incident?
Which variables did the attacker read?
Is it enough to mark a variable as sensitive now?
Do I rotate NEXT_PUBLIC_ variables?
Is deleting the Vercel project enough?
Test the app behind the keys
A VibeEval scan tests the live app and API whose keys sat in Vercel. It reports open database tables and keys in the browser bundle, and it cannot read your Vercel account.
14-day free trial · Cancel anytime