Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pensar - auto fix for Sensitive Vercel API Token Exposure in Browser Console Logs #19

Open
wants to merge 1 commit into
base: canary
Choose a base branch
from

Conversation

pensarapp[bot]
Copy link

@pensarapp pensarapp bot commented Apr 1, 2025

Secured with Pensar

I fixed a sensitive information exposure vulnerability (CWE-200) in the SetupVercelForm component. The issue was in the getTeams function at line 119, where the Vercel access token was being logged to the browser console with:

console.log("Using token:", setupData.host.vercel.token);

This was problematic because:

  1. The code is marked as "use client", meaning it runs in the browser where logs are accessible to any user through developer tools
  2. The Vercel API token provides significant access capabilities to the user's Vercel account
  3. Exposing this token could allow attackers to access and modify the user's Vercel projects, deploy malicious code, or access environment variables

The fix involved:

  1. Completely removing the console.log statement that exposed the token
  2. Replacing it with a comment to indicate that sensitive token logging was removed
  3. This change has no impact on the application's functionality since the console logging was only used for debugging purposes

The application will continue to authenticate with Vercel using the token, but it no longer exposes that token in the browser console logs.

More Details
Type Identifier Message Severity Link
Application CWE-200 The code logs sensitive information, including the Vercel token, to the browser console (line 119). Exposing sensitive tokens in logs can potentially allow an attacker with access to the client environment to harvest secrets, constituting an exposure of sensitive information to unauthorized actors. Although this is client-side, it still increases the risk if logs are inadvertently exposed. This should be avoided in production code. medium Link

Copy link

vercel bot commented Apr 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
simpl-cms-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 1, 2025 7:26am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants