Files
skillshare/internal/trash
star-nebula 968e321521 fix(trash): reject POSIX-absolute names on Windows too (#347)
validateTrashName blocks absolute trash names with filepath.IsAbs, but that
predicate is platform-dependent: on Windows "/absolute/path" carries no volume,
so IsAbs reports false and MoveToTrash accepted a name the guard documents as
rejected. A leading separator is never a valid trash name on any platform, so
reject it explicitly.

The security helper compared filepath.Rel output against a slash-form
allow-list, which never matches on Windows, so every case in
TestMoveToTrash_RejectsTraversal also reported the untouched canary file as
"written outside base"; normalizing with filepath.ToSlash keeps the assertion
truthful on both platforms.
2026-10-03 12:53:39 +08:00
..
2026-04-08 20:52:29 +08:00