Skip to content

Fix/security advisories - #55

Merged
godronus merged 23 commits into
mainfrom
fix/security-advisories
Sep 9, 2026
Merged

godronus merged 23 commits into
mainfrom
fix/security-advisories

Conversation

@godronus

@godronus godronus commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

- 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.
Copilot AI lite review requested due to automatic review settings September 7, 2026 12:10

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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.path as an empty string (or whitespace), resolveDotenvPathFromWorkspace() returns undefined, and the code no longer falls back to WORKSPACE_PATH (unlike the previous resolve(...) || WORKSPACE_PATH behavior). 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: if dotenv.path is an empty string/whitespace, resolveDotenvPathFromWorkspace() returns undefined and the handler won’t fall back to WORKSPACE_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

@godronus
godronus requested a review from qrdl September 9, 2026 12:39
@godronus
godronus merged commit 93d8046 into main Sep 9, 2026
8 checks passed
@godronus
godronus deleted the fix/security-advisories branch September 9, 2026 12:44
@godronus

godronus commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator Author

🎉 This PR is included in version 0.2.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants