ModernUO/Projects/UOContent.Tests
Kamron Batman 078be52777
fix: reject archive entries that extract outside the output directory (#2720)
## Summary
`ManagedArchive.ExtractTarFromStream` joined each tar entry name directly onto the output directory, so an entry such as `../x`, `sub/../../x` or an absolute path was written outside it. The restore path (`AutoArchive` → `ExtractTarZstd`/`ExtractTarGz`/`ExtractTar`) feeds archives through this method.

Each entry now resolves to a full path and must stay under the output root (case-insensitive on Windows). An entry that escapes fails the extraction; the existing `catch` in each `Extract*` method logs it and returns `false`.

The input is the server's own backup archives, so this is hardening against a tampered or foreign archive, not something a player can reach.

## Tests
- `ExtractTar_EntryOutsideOutputDirectory_IsRejected` (`../escaped.txt`, `sub/../../escaped.txt`) and `ExtractTar_RootedEntry_IsRejected`. All three fail without the fix.
- All 18 `ManagedArchiveTests` pass.
2026-10-18 20:06:23 -07:00
..
Fixtures refactor(spawners): subclass-owned entries, lifecycle hooks, per-entry Disabled flag (#2621) 2026-09-11 17:41:08 -07:00
Tests fix: reject archive entries that extract outside the output directory (#2720) 2026-10-18 20:06:23 -07:00
UOContent.Tests.csproj fix: Updates dependencies (#2714) 2026-10-17 13:54:25 -07:00