Fix/security advisories - #55
Merged
Merged
Conversation
- Bind to 127.0.0.1 by default (FASTEDGE_BIND_HOST overrides) - Generate a random 32-byte session token at startup; all /api/* requests and WebSocket connections must carry it. CLI logs the token URL to stderr; VSCode extension path uses FASTEDGE_DEBUG_TOKEN env. - Validate Host header on /api/* to block DNS-rebinding - WebSocket verifyClient checks token query param and origin allowlist - Frontend reads token from URL fragment (location.hash); injects it on every API call and WebSocket URL via apiFetch wrapper and useWebSocket hook - save-as now only accepts paths vended by the Electron save dialog in the same session (single-use pendingSavePaths capability set) - dotenv and WASM paths now containment-checked under WORKSPACE_PATH using both lexical and realpathSync checks; symlink escapes rejected - Added egressPolicy.ts: blocks cloud metadata / link-local IP ranges for WASM outbound callouts; resolves hostnames before check - DANGEROUS_PATHS matching rewritten to be segment-aware (no substring collisions); schema route uses startup-time allowlist to prevent traversal - Accepted limitation: synchronous WASM execution can block the event loop; documented in docs/SECURITY.md with rationale and upgrade path
Audit docs moved to fastedge-coordinator/context/security-advisories/ so they do not ship to users of this public package.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…test into fix/security-advisories
godronus
force-pushed
the
fix/security-advisories
branch
from
September 8, 2026 14:15
fbb91f4 to
6b629a0
Compare
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
/api/load and /api/dotenv treat an empty/whitespace dotenv.path as “provided” but resolve it to undefined, losing the intended fallback to WORKSPACE_PATH and potentially loading dotenv from the server CWD.
Review details
Suppressed comments (2)
Previously missed (1) — in code that hasn't changed since the last review.
server/server.ts:272
- If the client sends
dotenv.pathas an empty string (or whitespace),resolveDotenvPathFromWorkspace()returnsundefined, and the code no longer falls back toWORKSPACE_PATH(unlike the previousresolve(...) || WORKSPACE_PATHbehavior). That can make dotenv implicitly load from the server CWD instead of the workspace root.
This issue also appears on line 428 of the same file.
server/server.ts:431
- Same as
/api/load: ifdotenv.pathis an empty string/whitespace,resolveDotenvPathFromWorkspace()returnsundefinedand the handler won’t fall back toWORKSPACE_PATH, which can make dotenv unexpectedly resolve relative to the server CWD.
- Files reviewed: 45/45 changed files
- Comments generated: 0 new
- Review effort level: Lite
NOT AN ISSUE: Fallback to CWD has no attack vector. It will error on not in --project-dir - already covered by Form Errors
qrdl
approved these changes
Sep 9, 2026
Collaborator
Author
|
🎉 This PR is included in version 0.2.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
No description provided.