fix(security): harden root-scoped writes against symlink races

This commit is contained in:
Peter Steinberger
2026-03-02 01:27:17 +00:00
parent bfeadb80b6
commit 710004e011
4 changed files with 111 additions and 4 deletions

View File

@@ -217,6 +217,7 @@ beforeEach(() => {
({
stat: async () => makeFileStat(),
readFile: async () => Buffer.from(""),
truncate: async () => {},
writeFile: async () => {},
close: async () => {},
}) as unknown,
@@ -621,6 +622,7 @@ describe("agents.files.get/set symlink safety", () => {
({
stat: async () => targetStat,
readFile: async () => Buffer.from("inside\n"),
truncate: async () => {},
writeFile: async () => {},
close: async () => {},
}) as unknown,