Security hardening: Input validation, CORS, and JWT secret handling#6
Draft
Security hardening: Input validation, CORS, and JWT secret handling#6
Conversation
- Add sanitization functions for Git URLs, branch names, and file paths - Fix CORS to use configurable origins (CORS_ORIGINS env var) instead of wildcard - Replace hardcoded JWT secret with secure random default - Add timeout to exec_command function - Use shlex.quote for shell command parameters - Add comprehensive security tests (31 tests) Co-authored-by: quan0715 <60366187+quan0715@users.noreply.github.com>
…d path traversal patterns - Fix CORS_ORIGINS parsing to handle empty strings correctly - Fix JWT_SECRET_KEY warning to check environment variable directly - Add comprehensive URL-encoded path traversal patterns (%2f, %252f) - Simplify Git URL validation regex Co-authored-by: quan0715 <60366187+quan0715@users.noreply.github.com>
Co-authored-by: quan0715 <60366187+quan0715@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Conduct security review for project
Security hardening: Input validation, CORS, and JWT secret handling
Feb 5, 2026
Owner
|
@copilot Resolve Conflict |
- Merged container_service.py: kept enhanced _sanitize_path function - Merged .env.example: kept CORS_ORIGINS setting, used main's higher resource limits (4.0 CPU, 8g memory) - Preserved all security enhancements: JWT secret handling, CORS configuration, input sanitization - All 31 security tests passing Co-authored-by: quan0715 <60366187+quan0715@users.noreply.github.com>
Author
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.
Security Review Summary
Vulnerabilities Fixed:
*to configurable origins viaCORS_ORIGINSenv varTests Added:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.