Skip to content

fix: SDK key detection to avoid false positives with third-party identifier#345

Merged
swarnava merged 1 commit intomainfrom
fix/sdk-key-detection-regex
Mar 21, 2026
Merged

fix: SDK key detection to avoid false positives with third-party identifier#345
swarnava merged 1 commit intomainfrom
fix/sdk-key-detection-regex

Conversation

@swarnava
Copy link
Copy Markdown
Member

@swarnava swarnava commented Mar 21, 2026

The SDK key validation now uses a regex /^vf_(?:server|client)_/ to require the format vf_server_* or vf_client_* instead of accepting any string starting with vf_. This prevents false positives with third-party service identifiers that happen to start with vf_ (e.g., Stripe identity flow IDs like vf_1PyHgVLpWuMxVFx...).

Adds isValidSdkKey() helper function and updates parseSdkKeyFromFlagsConnectionString() to use the stricter validation. Updates all tests to use valid SDK key formats.

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flags-playground Ready Ready Preview, Comment, Open in v0 Mar 21, 2026 5:39pm
flags-sdk-dev Ready Ready Preview, Comment, Open in v0 Mar 21, 2026 5:39pm
flags-sdk-snippets Ready Ready Preview, Comment, Open in v0 Mar 21, 2026 5:39pm
flags-sdk-sveltekit-snippets Ready Ready Preview, Comment, Open in v0 Mar 21, 2026 5:39pm
shirt-shop Ready Ready Preview, Comment, Open in v0 Mar 21, 2026 5:39pm
shirt-shop-api Ready Ready Preview, Comment, Open in v0 Mar 21, 2026 5:39pm

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 21, 2026

You must have Developer access to commit code to Uncurated Tests - Temporary on Vercel. If you contact an administrator and receive Developer access, commit again to see your changes.

Learn more: https://vercel.com/docs/accounts/team-members-and-roles/access-roles#team-level-roles

…tifiers

The SDK key validation now uses a regex (/^vf_(?:server|client)_/) to require
the format vf_server_* or vf_client_* instead of accepting any string starting
with vf_. This prevents false positives with third-party service identifiers
that happen to start with vf_ (e.g., Stripe identity flow IDs like
vf_1PyHgVLpWuMxVFx...).

Adds isValidSdkKey() helper function and updates parseSdkKeyFromFlagsConnectionString()
to use the stricter validation. Updates all tests to use valid SDK key formats.
@swarnava swarnava enabled auto-merge (squash) March 21, 2026 17:38
@swarnava swarnava merged commit b755ffe into main Mar 21, 2026
15 of 18 checks passed
@swarnava swarnava deleted the fix/sdk-key-detection-regex branch March 21, 2026 17:39
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.

2 participants