-
Notifications
You must be signed in to change notification settings - Fork 0
🛡️ Sentinel: [CRITICAL] Fix hardcoded secrets and insecure CORS #27
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
Open
LVT-ENG
wants to merge
3
commits into
main
Choose a base branch
from
sentinel/fix-secrets-and-cors-11817250805623812944
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # TRYONYOU Divineo Bunker Environment Variables | ||
| # Copy this file to .env and fill in the values | ||
|
|
||
| # HMAC secret key for biometric authentication | ||
| # Ensure this is a long, random string in production | ||
| LVT_SECRET_KEY=generate_a_secure_random_key_here | ||
|
|
||
| # Google Gemini AI API Key | ||
| # Get yours from https://aistudio.google.com/app/apikey | ||
| GEMINI_API_KEY=your_gemini_api_key_here | ||
|
|
||
| # Staff Dashboard Password | ||
| STAFF_PASSWORD=SAC_MUSEUM_2026 | ||
|
|
||
| # Allowed CORS origins (comma-separated list) | ||
| # Default for development is '*' | ||
| # Production example: https://tryonyou.app,https://api.tryonyou.app | ||
| LVT_ALLOWED_ORIGINS=http://localhost:5173,https://tryonyou.app |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Sentinel Security Journal | ||
|
|
||
| ## 2025-05-15 - [Hardcoded Secrets and Insecure CORS] | ||
| **Vulnerability:** Hardcoded HMAC secret key in backend and unrestricted CORS origins. | ||
| **Learning:** Initial prototype code often includes hardcoded secrets for convenience, which must be externalized before deployment. Insecure CORS (*) allows any site to make requests to the API, which can be risky if authentication is weak or if sensitive data is involved. | ||
| **Prevention:** Use environment variables for all secrets and specific origin lists for CORS from the start. Use a `.env.example` to document requirements. | ||
|
|
||
| ## 2025-05-15 - [Hardcoded Password in Frontend] | ||
| **Vulnerability:** A staff password was hardcoded in the frontend JavaScript, making it easily discoverable by anyone inspecting the code. | ||
| **Learning:** Frontend authentication checks are only for UI guidance and should always be backed by a secure backend verification. | ||
| **Prevention:** Always verify sensitive credentials on the backend using constant-time comparison (like `hmac.compare_digest`) and keep passwords in environment variables. |
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Binary file not shown.
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.