keryx 0.39.0 → 0.39.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keryx",
3
- "version": "0.39.0",
3
+ "version": "0.39.1",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -55,7 +55,10 @@ export async function handleStaticFile(
55
55
  const fullPath = path.resolve(path.join(staticDir, finalPath));
56
56
  const basePath = path.resolve(staticDir);
57
57
 
58
- // Prevent path traversal attacks (e.g. symlinks or encoded sequences)
58
+ // Reject anything that escapes the static root after lexical normalization
59
+ // (path.resolve collapses `..`/`.` segments). Symlink escapes are caught
60
+ // separately by resolveWithinStaticRoot below; encoded sequences (e.g.
61
+ // %2e%2e) are never decoded, so they stay literal and cannot form `..`.
59
62
  if (!fullPath.startsWith(basePath + path.sep) && fullPath !== basePath) {
60
63
  return null;
61
64
  }