Skip to content

[deployment] Remove hardcoded GitHub token from demo gallery - #22

Merged
nirlipo merged 1 commit into
deploymentfrom
security/remove-github-token-deployment
Oct 12, 2026
Merged

nirlipo merged 1 commit into
deploymentfrom
security/remove-github-token-deployment

Conversation

@nirlipo

@nirlipo nirlipo commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Cherry-pick of the main fix onto deployment.

Summary

  • Removes the hardcoded GitHub personal access token from DemoCards.jsx and DemoCard.jsx. It was shipped in the public JS bundle and reported by the university security team. The token has already been revoked.
  • The gallery only reads the public planimation/documentation repo, so it now uses one unauthenticated Git Trees API request plus raw.githubusercontent.com file fetches. That is 1 API call per gallery open instead of 21, which stays within the 60/hour anonymous limit.
  • Adds a Secret scan workflow: it fails on GitHub token prefixes (including split strings like "ghp_…" + "…") and runs gitleaks on the working tree.

Test plan

  • npm run build succeeds; build/ contains no ghp_ / github_pat_
  • Grouping logic run against the live tree: 20 gallery cards, files resolve via raw URLs (HTTP 200)
  • Scan step passes on this branch and fails on the previous code
  • Open the gallery in the deployed app and load a demo

🤖 Generated with Claude Code

The gallery embedded a GitHub personal access token in front-end code,
which shipped in the public JS bundle and granted write access to every
public repo its owner could push to. The token has been revoked.

The gallery only reads the public planimation/documentation repo, so no
authentication is needed. It now makes a single unauthenticated Git
Trees API request and loads files from raw.githubusercontent.com, which
stays within the anonymous rate limit (previously 21 API calls per open).

Also adds a CI secret-scan workflow that rejects GitHub token prefixes
(including tokens split across concatenated strings) and runs gitleaks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 12e51eb)
@nirlipo
nirlipo merged commit 795fd81 into deployment Oct 12, 2026
2 checks passed
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.

1 participant