Skip to content

fix(security): prevent path traversal in file proxies and ensure normalizePath is idempotent - #191

Open
DNL5555 wants to merge 3 commits into
tscircuit:mainfrom
DNL5555:fix/proxy-path-traversal-and-idempotent-normalize
Open

DNL5555 wants to merge 3 commits into
tscircuit:mainfrom
DNL5555:fix/proxy-path-traversal-and-idempotent-normalize

Conversation

@DNL5555

@DNL5555 DNL5555 commented Nov 8, 2026

Copy link
Copy Markdown

markdown
Fixes #173
Fixes #161

Summary of Changes

  • Fixed CWE-22 Path Traversal in disk file proxies by validating that resolved paths strictly reside within the configured diskPath root directory.
  • Fixed non-idempotent normalizePath by adding global /g flag in multi-slash regex replacement (replace(/\/\/+/g, "/")).
  • Added regression test suite in tests/routes/security-and-normalization.test.ts (31/31 tests passing).

@DNL5555

DNL5555 commented Nov 14, 2026

Copy link
Copy Markdown
Author

Hi @seveibar, all CI checks are now green on this PR and it's ready for review whenever you have a moment. Thanks!

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

Labels

None yet

Projects

None yet

1 participant