@grainulation/orchard 1.0.4 → 1.1.0

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.
Files changed (2) hide show
  1. package/lib/server.js +8 -0
  2. package/package.json +1 -1
package/lib/server.js CHANGED
@@ -790,6 +790,14 @@ ${ROUTES.map((r) => "<tr><td><code>" + r.method + "</code></td><td><code>" + r.p
790
790
  let filePath = url.pathname;
791
791
  filePath = join(PUBLIC_DIR, filePath);
792
792
 
793
+ // Prevent directory traversal
794
+ const resolved = resolve(filePath);
795
+ if (!resolved.startsWith(PUBLIC_DIR + "/") && resolved !== PUBLIC_DIR) {
796
+ res.writeHead(403);
797
+ res.end("Forbidden");
798
+ return;
799
+ }
800
+
793
801
  if (existsSync(filePath) && !statSync(filePath).isDirectory()) {
794
802
  const ext = extname(filePath);
795
803
  const mime = MIME[ext] || "application/octet-stream";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grainulation/orchard",
3
- "version": "1.0.4",
3
+ "version": "1.1.0",
4
4
  "description": "Multi-sprint research orchestrator — coordinate parallel research across teams",
5
5
  "main": "lib/planner.js",
6
6
  "exports": {