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 +1 -1
- package/util/webStaticFiles.ts +4 -1
package/package.json
CHANGED
package/util/webStaticFiles.ts
CHANGED
|
@@ -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
|
-
//
|
|
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
|
}
|