Repository navigation
fix(security): remove hardcoded Logo.dev publishable key (GH-192) - #9
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dennisofficial
marked this pull request as ready for review
September 23, 2026 17:36
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GH-192 — Live Logo.dev API key hardcoded in this PUBLIC repo
Glass House finding: EXPOSED_SECRET, P1, CONFIRMED.
A live Logo.dev publishable key (
pk_AZat…) was hardcoded atapps/example/src/app/(app)/vendors/vendors.data.ts:11and inlined into 8 story URLs inapps/storybook/stories/OrganizationSelector.stories.tsx. Verified live at filing time: a GET toimg.logo.devwith the key returned 200. Because this repo is public, anyone could drive traffic against Comp AI's Logo.dev account, exhausting or inflating its quota/billing.Fix
vendors.data.ts: key replaced withprocess.env.NEXT_PUBLIC_LOGO_DEV_TOKEN; when unset, logo URLs are built without a token.OrganizationSelector.stories.tsx: 8 token-inlined URLs replaced with alogoDev()helper readingimport.meta.env.STORYBOOK_LOGO_DEV_TOKEN(addedstories/vite-env.d.tsfor typing).apps/example/.env.exampledocumenting the variable (with a.gitignoreexception, since.env*is ignored there).No git history was rewritten.
🚨 Needs human action — not done by this PR
The leaked key is live and remains in the git history of this public repo. Removing it at HEAD does not revoke it. A human must:
NEXT_PUBLIC_LOGO_DEV_TOKEN(example app) /STORYBOOK_LOGO_DEV_TOKEN(Storybook) locally where live logos are wanted.Verification
pnpm --filter @comp/example typecheck— passes.tsc --noEmit— zero errors in changed files (18 errors elsewhere are identical on cleanorigin/main, pre-existing).vitest run --project unit): 126/130 pass — the 4 failures (Badge/Button class assertions) are identical on cleanorigin/main, pre-existing.grep -rn "pk_AZat"over the tree: no matches.Summary by cubic
Removes the hardcoded Logo.dev publishable key from the example app and Storybook, replacing it with environment variables so no real token is committed to this public repo.
vendors.data.tsnow readsNEXT_PUBLIC_LOGO_DEV_TOKENand builds token-less logo URLs when it is unset.logoDev()helper backed bySTORYBOOK_LOGO_DEV_TOKEN, with typings added viavite-env.d.ts.apps/example/.env.exampledocumenting the variable and a.gitignoreexception for it.Action required: the leaked key remains valid and is still in git history. Rotate it at the Logo.dev dashboard and restrict the new key by domain/referrer.
Written for commit 66aed88. Summary will update on new commits.