ModernUO/Projects
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
..
Application fix: Bumps dependencies. (#2531) 2026-07-14 15:17:55 -07:00
BuildTool feat: Bumps dependencies. Introduces Serialization Generator v3 (#2584) 2026-08-22 15:48:53 -07:00
Logger fix: Bumps dependencies. (#2531) 2026-07-14 15:17:55 -07:00
Server fix: Updates dependencies (#2714) 2026-10-17 13:54:25 -07:00
Server.Tests fix: Updates dependencies (#2714) 2026-10-17 13:54:25 -07:00
UOContent fix: reject archive entries that extract outside the output directory (#2720) 2026-10-18 20:06:23 -07:00
UOContent.Tests fix: reject archive entries that extract outside the output directory (#2720) 2026-10-18 20:06:23 -07:00