Auditing Vercel
Vercel is a deployment platform for web applications, closely tied to Next.js. Every Git push produces a deployment with its own URL, every branch gets previews and server functions receive the project’s environment variables. What you audit isn’t the application code: it’s the URLs left public, the secrets each build receives and the team account, which gives access to everything else.
Responsibility model
Section titled “Responsibility model”Vercel runs the infrastructure, the CDN and build isolation, and publishes a responsibility matrix in its Trust Center. The customer decides:
- which deployments are public;
- which type each variable has;
- who joins the team and with which role;
- which integrations get connected;
- how the firewall is configured.
flowchart LR
G["git push / PR"] --> B["Build<br/>environment variables,<br/>VERCEL_OIDC_TOKEN"]
F["PR from a fork"] -->|"Git Fork Protection:<br/>needs authorization"| B
B --> D1["Production domain<br/>app.example.com"]
B --> D2["Generated production URL<br/>project-abc123.vercel.app"]
B --> D3["Preview URLs<br/>per branch and commit"]
D2 --> P{"Deployment<br/>Protection"}
D3 --> P
P -->|"bypass, shareable links,<br/>exceptions"| V["Visitor"]
D1 --> W["Firewall / WAF"] --> V
Deployment Protection
Section titled “Deployment Protection”Every old deployment stays reachable at its URL. A preview from months ago may still be connected to the database with real data.
| Scope | What it protects | Notes |
|---|---|---|
| Standard Protection | Everything except your own production domains. Includes the generated production URL and every preview | Vercel’s recommended minimum |
| All Deployments | Everything, production included | For internal tools. Vercel announced that with Vercel Authentication it costs nothing on any plan (it used to be a paid add-on) |
| (Legacy) Pre-Production | Previews only | Leaves old production deployments and production branch URLs (*-main.vercel.app) reachable |
| Trusted IPs | By IPv4 list | Enterprise only |
| None | Nothing | A finding if previews use real data or secrets |
The methods are Vercel Authentication (team members), Password Protection and Trusted IPs.
Through the API, the project’s ssoProtection.deploymentType field shows the scope of Vercel Authentication:
prod_deployment_urls_and_all_previews: Standard.all: every deployment.preview: previews only, the legacy mode.null: disabled.
vercel project inspect <project> --jsonvercel api /v9/projects/<project> # ssoProtection, passwordProtection, gitForkProtection…vercel list <project> --environment previewWays to bypass protection
Section titled “Ways to bypass protection”They’re legitimate, but each one is a credential to inventory:
- Protection Bypass for Automation. It’s a secret sent in the
x-vercel-protection-bypassheader or as a URL parameter (required for webhooks). Vercel injects it into deployments asVERCEL_AUTOMATION_BYPASS_SECRET. A project can have several. Review who holds them and rotate them. The URL parameter ends up in histories and logs: the header is better. - Shareable Links. Links with a secret parameter that give outside access to a branch deployment.
- Deployment Protection Exceptions. They make specific preview domains public.
- OPTIONS Allowlist. It leaves paths unprotected for CORS preflight requests.
Environment variables
Section titled “Environment variables”| Type | Behavior | For |
|---|---|---|
| Config | Readable after saving by members with access | Non-sensitive configuration |
| Secret (formerly Sensitive) | Write-only: it can’t be read again, only replaced | Passwords, API keys, tokens |
Details that matter in an audit:
- A Secret can’t be converted to Config or vice versa. Old Sensitive variables already show up as Secret.
- In build logs, Vercel replaces Secrets of 32 characters or more with
[REDACTED], and alwaysVERCEL_AUTOMATION_BYPASS_SECRETandVERCEL_OIDC_TOKEN. - Secrets are now allowed in Development. They used to be limited to Production and Preview.
- The Separate Production Secret Values team policy requires each Secret to have a different value in Production than in Preview and Development. It replaces the old, now deprecated Enforce Sensitive Environment Variables.
- Variables created by integrations can’t be switched to Secret from the list. You have to:
- disconnect the integration;
- rotate its secrets;
- reconnect it without Development and with Sensitive turned on.
vercel env ls # type and environments of each variablevercel env add API_TOKEN --sensitive # Secret; --no-sensitive or --type config for ConfigWhat reaches the browser
Section titled “What reaches the browser”In Next.js, any variable prefixed with NEXT_PUBLIC_ is inlined into the client JavaScript at build time. It doesn’t matter that it’s marked as a Secret in Vercel. In a lab with Next.js 16.4.6, three variables were defined and each value was searched for in .next/static, which is what gets served to the browser:
NEXT_PUBLIC_STRIPE_KEY=sk_live_LAB_... (used in a 'use client' component) -> 1 fileSTRIPE_SECRET=sk_live_LAB_... (read in the same client component) -> 0 filesDATABASE_URL=postgres://...LAB... (used in a server component) -> 0 filessource maps (*.map) in .next/static -> 0STRIPE_SECRET read from a client component is simply undefined. Only the prefix exposes. In the outside view, download the production bundles and those of reachable previews and search for secret patterns (sk_live_, service_role, -----BEGIN, provider tokens).
Builds, forks and cloud credentials
Section titled “Builds, forks and cloud credentials”- Git Fork Protection is on by default: a PR from a fork needs a team member to authorize the deployment, so environment variables and the OIDC token don’t leak. If it’s turned off on a public repository, anyone can open a PR that runs a build with access to the variables.
- OIDC Federation replaces fixed AWS, Google Cloud or Azure credentials stored as variables with short-lived tokens signed by Vercel. In the provider’s trust policy, the
subcondition must pin the project and the environment. Without it, any project from the issuer could assume the role. - Logs and source code. The
/_logsand/_srcpaths of every deployment require team membership. This protection is always on and can’t be disabled. What you do audit is Vercel Support Code Visibility (Pro and Enterprise): it’s off by default and should only be turned on for the duration of a support case. - Deployment retention. The Deployment Retention Policy limits how long old deployments are kept. It’s how year-old previews stop existing.
Firewall
Section titled “Firewall”vercel firewall overview- Custom rules with log, deny, challenge, bypass and rate limit actions. A bypass rule that’s too broad cancels out the others.
- Managed rulesets: OWASP, bot protection and AI bots. Vercel recommends starting in log mode.
- Attack Mode, for targeted attacks: it’s turned on for 1, 6 or 24 hours.
Team, tokens and integrations
Section titled “Team, tokens and integrations”- MFA for every member, with an authenticator app and a passkey. It was the first thing Vercel asked of its customers in the 2026 incident.
- Minimal roles per member and a review of stale members. SAML SSO if the plan includes it.
- Personal tokens:
vercel tokens list. Revoke those without a clear owner or use. - Activity log:
vercel activity. Review changes to variables, domains and protection. - Marketplace integrations and OAuth apps connected to the team’s Google or GitHub accounts: each one is a way in.
Next.js and middleware
Section titled “Next.js and middleware”CVE-2025-29927 (CVSS 9.1) made it possible to skip Next.js middleware by sending the internal x-middleware-subrequest header, which voided authentication checks done only there. It affected versions 11.1.4 through 15.2.2 and was fixed in 15.2.3, 14.2.25, 13.5.9 and 12.3.5. Vercel stated that applications hosted on its platform weren’t affected, but self-hosted ones were.
In an audit:
- check the version with
npm ls nextin every project, including those deployed outside Vercel; - check that authorization doesn’t depend on middleware alone.
Testing: what Vercel allows
Section titled “Testing: what Vercel allows”Penetration testing is allowed on Pro and Enterprise plans, against your own applications and never the infrastructure. It isn’t allowed on Hobby. Volumetric testing, such as automated scanners sending many requests, requires Enterprise and prior notice. Vercel recommends setting the testing IPs to bypass in the project’s WAF.
Real cases
Section titled “Real cases”-
Vercel incident (April 2026). The attack started with the compromise of Context.ai, a third-party AI tool used by an employee:
- through its OAuth app, the attacker took over the employee’s Google Workspace account;
- from there they got into the employee’s Vercel account;
- they reached an internal environment, where they enumerated and decrypted customer environment variables not marked as sensitive.
Vercel asked its customers to:
- turn on MFA;
- rotate non-sensitive variables first and use the Secret type;
- review the activity log and recent deployments;
- apply Standard Protection at minimum;
- rotate bypass secrets;
- check whether their Google Workspace had authorized the compromised OAuth app.
The incident was declared closed on October 16, 2026.
-
CVE-2025-29927 (March 2025). An authentication bypass with a single header in self-hosted Next.js applications, explained in the previous section.
Checklist
Section titled “Checklist”- Standard Protection at minimum; All Deployments for internal tools
- No preview or old deployment reachable with production data or secrets
- Bypass secrets, shareable links and protection exceptions inventoried and rotated
- Every credential stored as a Secret; Config only for non-sensitive values
- Separate Production Secret Values on; production secrets different from preview and development
- No secret with a
NEXT_PUBLIC_prefix, and none in production or preview bundles - Git Fork Protection on for public repositories
- OIDC Federation instead of fixed cloud keys, with
sublimited to project and environment - Deployment Retention Policy set; Vercel Support Code Visibility off unless a case is open
- Firewall reviewed: no broad bypass rules; managed rulesets tested in log mode
- MFA for every member; minimal roles; personal tokens reviewed
- Activity log reviewed; integrations and OAuth apps inventoried
- Next.js on a fixed version; authorization doesn’t depend on middleware alone
- Testing within Vercel’s policy (Pro or Enterprise plan, no volumetric testing without notice)
References
Section titled “References”- Vercel: Deployment Protection
- Vercel: Methods to bypass Deployment Protection
- Vercel: Protection Bypass for Automation
- Vercel: Config and Secret environment variables
- Vercel: Security settings
- Vercel: Deployment Retention Policy
- Vercel: OpenID Connect (OIDC) Federation
- Vercel: WAF custom rules
- Vercel: Attack Mode
- Vercel: Penetration testing on Vercel
- Vercel: April 2026 security incident
- Next.js: Environment variables
- Next.js: CVE-2025-29927