refactor(security): unify path alias guard policies

This commit is contained in:
Peter Steinberger
2026-02-26 03:59:08 +01:00
parent 8a006a3260
commit de61e9c977
5 changed files with 126 additions and 142 deletions

View File

@@ -6,9 +6,9 @@ export async function assertNoHardlinkedFinalPath(params: {
filePath: string;
root: string;
boundaryLabel: string;
allowFinalHardlink?: boolean;
allowFinalHardlinkForUnlink?: boolean;
}): Promise<void> {
if (params.allowFinalHardlink) {
if (params.allowFinalHardlinkForUnlink) {
return;
}
let stat: Awaited<ReturnType<typeof fs.stat>>;