Harden security defaults: unsafe tools off, CORS lockdown, error sanitization#22
Merged
Harden security defaults: unsafe tools off, CORS lockdown, error sanitization#22
Conversation
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| Java | Mar 27, 2026 11:35a.m. | Review ↗ | |
| Shell | Mar 27, 2026 11:35a.m. | Review ↗ | |
| Python | Mar 27, 2026 11:35a.m. | Review ↗ | |
| Secrets | Mar 27, 2026 11:35a.m. | Review ↗ |
- Change JL_LOCAL_UNSAFE_TOOLS default from "1" to "0" (opt-in, not opt-out) - Update .env.example to match safe default - Fix CORS origin reflection in mcp_https_proxy.py (use allowlist) - Sanitize proxy error responses to not leak exception details - Tighten CORS methods/headers in api_app.py (explicit lists) - Update quest_runtime.py to respect env-based unsafe tools default - Update SECURITY.md to document changes Agent-Logs-Url: https://github.com/jaden688/JL_Engine-local/sessions/516698b7-cb1d-4c2d-b679-da97deb72ffe Co-authored-by: jaden688 <173667368+jaden688@users.noreply.github.com>
Agent-Logs-Url: https://github.com/jaden688/JL_Engine-local/sessions/516698b7-cb1d-4c2d-b679-da97deb72ffe Co-authored-by: jaden688 <173667368+jaden688@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix security issues identified in the project
Harden security defaults: unsafe tools off, CORS lockdown, error sanitization
Mar 27, 2026
jaden688
approved these changes
Mar 27, 2026
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.
Several security posture issues: shell/bridge tools enabled by default, CORS origin reflection in the MCP proxy, exception details leaked to clients, and wildcard CORS methods/headers in the core API.
Unsafe tools default to OFF
JL_LOCAL_UNSAFE_TOOLSdefault changed from"1"→"0"inbuiltin.py,quest_runtime.py,.env.exampleJL-Engine-local.py) still explicitly sets"1"— no behavior change for that entrypointCORS origin reflection → allowlist
mcp_https_proxy.pyreflected any clientOriginheader verbatim and fell back to*Proxy error response sanitization
str(exc)was interpolated into client-facing JSON"An internal proxy error occurred."and logs the real error server-sideTighten CORS in core API
api_app.py:allow_methods=["*"]/allow_headers=["*"]→ explicit lists of methods and headers actually usedSECURITY.md
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.