[CLI] vercel build treats [SENSITIVE] placeholders from vercel pull as environment values
Description
vercel pull intentionally writes [SENSITIVE] for Sensitive Environment Variables whose values cannot be retrieved. vercel build then loads .vercel/.env.<target>.local through dotenv, so application build code receives the literal placeholder as the environment variable value.
PR #17125 introduced the placeholder so redacted variables are distinguishable from genuinely empty strings. The current pull implementation defines that placeholder and writes it for every redacted Sensitive key. The current build implementation loads the generated file into the build process without recognizing the placeholder.
This affects the documented GitLab CI flow, which runs vercel pull, vercel build, and vercel deploy --prebuilt in sequence.
Steps to reproduce
- Link a project that has a Preview environment variable named
EXAMPLE_URLmarked as Sensitive. - Make the build command check the value without printing it:
if (process.env.EXAMPLE_URL === "[SENSITIVE]") {
throw new Error("Sensitive placeholder was injected into the build");
}- Run:
vercel pull --yes --environment=preview
vercel build- The build code observes
process.env.EXAMPLE_URL === "[SENSITIVE]".
Expected behavior
The reserved placeholder should not be exposed to application build code as an ordinary configuration value. vercel build could either:
- treat those entries as unavailable or unset and emit a warning that lists only the affected variable names; or
- fail early with an actionable error explaining that Sensitive values are unavailable to a local prebuilt build.
Either behavior would preserve the Sensitive value security boundary.
Actual behavior
The literal [SENSITIVE] marker is injected into the build environment. Applications that parse the variable as a URL, number, JSON document, or another structured value then fail with a misleading validation error.
This report is not asking vercel pull or vercel build to retrieve or expose Sensitive values. It is only about preventing a reserved redaction marker from being treated as application data.
Source: vercel/vercel