Fork of backnotprop/plannotator with reduced surface area

fix(server): prevent arbitrary file read via /api/image endpoint (#164)

The /api/image endpoint serves files from the local filesystem based on a user-provided path parameter with no validation. This allows any process on localhost to read arbitrary files (e.g., /etc/passwd, ~/.ssh/id_rsa) by requesting /api/image?path=<any-path>. This commit adds: - Path validation requiring image file extensions (png, jpg, gif, etc.) - Path resolution via path.resolve() to normalize traversal sequences - Upload extension validation against the same image allowlist - Shared image.ts module used by all three servers (plan, review, annotate) [agent]


Author Dor Tzur Committer GitHub Date Commit Parent 6a2e7dbd
+101 -15
4 changed files
+101 -15
4 changed files