mirror of
https://github.com/samiyev/puaros.git
synced 2025-12-27 23:06:54 +05:00
feat(ipuaro): add PathValidator security utility (v0.13.0)
Add centralized path validation to prevent path traversal attacks. - PathValidator class with sync/async validation methods - Protects against '..' and '~' traversal patterns - Validates paths are within project root - Refactored all 7 file tools to use PathValidator - 51 new tests for PathValidator
This commit is contained in:
@@ -189,7 +189,7 @@ describe("DeleteFileTool", () => {
|
||||
const result = await tool.execute({ path: "../outside/file.ts" }, ctx)
|
||||
|
||||
expect(result.success).toBe(false)
|
||||
expect(result.error).toBe("Path must be within project root")
|
||||
expect(result.error).toBe("Path contains traversal patterns")
|
||||
})
|
||||
|
||||
it("should return error if file does not exist", async () => {
|
||||
|
||||
Reference in New Issue
Block a user