Skip to content

Harden network allow-list, error sanitization, and ReadWriteFs root validation#160

Merged
cramforce merged 3 commits intomainfrom
hardening-3-18
Mar 20, 2026
Merged

Harden network allow-list, error sanitization, and ReadWriteFs root validation#160
cramforce merged 3 commits intomainfrom
hardening-3-18

Conversation

@cramforce
Copy link
Copy Markdown
Contributor

@cramforce cramforce commented Mar 18, 2026

  • Fix path prefix matching to use segment boundaries instead of raw startsWith, preventing /v1 from matching /v10 or /v1-admin
  • Reject ambiguous encoded separators (%2f, %5c) in path-scoped entries
  • Move allow-list check before DNS resolution to avoid leaking DNS lookups for disallowed hosts
  • Split sanitizeErrorMessage into a lighter guest-facing variant and an aggressive sanitizeHostErrorMessage for worker/bootstrap errors that also scrubs file:// URLs, UNC paths, and additional host prefixes

…alidation

- Fix path prefix matching to use segment boundaries instead of raw
  startsWith, preventing /v1 from matching /v10 or /v1-admin
- Reject ambiguous encoded separators (%2f, %5c) in path-scoped entries
- Move allow-list check before DNS resolution to avoid leaking DNS
  lookups for disallowed hosts
- Add ReadWriteFs overlap guard to reject writable roots that contain
  the just-bash package tree (src/, dist/, node_modules/, vendor/)
- Split sanitizeErrorMessage into a lighter guest-facing variant and
  an aggressive sanitizeHostErrorMessage for worker/bootstrap errors
  that also scrubs file:// URLs, UNC paths, and additional host prefixes
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
just-bash-website Ready Ready Preview, Comment Mar 19, 2026 11:53pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
just-bash Ignored Ignored Mar 19, 2026 11:53pm

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant