fix(security): securely authenticate git clone and redact log tokens#6225
Open
tamilr0727-ux wants to merge 1 commit into
Open
fix(security): securely authenticate git clone and redact log tokens#6225tamilr0727-ux wants to merge 1 commit into
tamilr0727-ux wants to merge 1 commit into
Conversation
Contributor
|
@tamilr0727-ux is attempting to deploy a commit to the jhasourav07's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
📦 Next.js Bundle Size Report (Gzipped Sizes)✨ No significant bundle size changes detected. 📊 Summary of Totals
|
Aamod-Dev
approved these changes
Jun 21, 2026
Aamod-Dev
left a comment
Collaborator
There was a problem hiding this comment.
Thank you for addressing the GitHub PAT exposure in app/api/architecture/route.ts. Removing the token from the clone URL and sanitizing the logs is the right approach to prevent credential leakage. Adding tests in app/api/architecture/route.test.ts is also a great addition. Approved!
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.
Description
Removes GitHub Personal Access Token (PAT) exposure from the repository cloning workflow in
app/api/architecture/route.tsand prevents credential leakage through process arguments and application logs.Problem
The architecture analysis route constructed clone URLs using embedded credentials:
https://username:${process.env.GITHUB_TOKEN}@github.com/${fullName}.gitThis created two critical security risks:
Process Table Exposure
The token became part of the
git clonecommand line, making it potentially visible through:ps auxLog Exposure
When clone operations failed, the full repository URL was logged:
This could expose credentials through:
Changes
Secure Repository Authentication
Logging Hardening
Error Handling Improvements
Security Impact
Before
After
Test Coverage
Added tests covering:
Validation
✅ All tests pass successfully.
✅ Clone operations continue to function correctly.
✅ GitHub tokens no longer appear in logged metadata.
✅ Credentials are not exposed through process arguments.
Impact
Fixes #6185
Pillar
Visual Preview
Can Check in the Files Changed Section
Checklist before requesting a review:
CONTRIBUTING.mdfile.localhost:3000/api/streak?user=YOUR_USERNAME).npm run formatandnpm run lintlocally and resolved all errors (CI will fail otherwise).feat(themes): ...,fix(calculate): ...).README.mdif I added a new theme or URL parameter.