Inf1mum opened a new pull request, #842: URL: https://github.com/apache/commons-compress/pull/842
Fixes [COMPRESS-725](https://issues.apache.org/jira/browse/COMPRESS-725). ## Problem The decompression example in the class Javadoc of `ArchiveStreamFactory` resolved archive entry names with `dir.toPath().resolve(entry.getName())`. Entry names in untrusted archives are attacker-controlled and may contain `..` segments, so the documented pattern teaches an extraction loop vulnerable to Zip Slip path traversal (CWE-22), the issue reported in COMPRESS-725. ## Change Documentation only: - the example now extracts through `entry.resolveIn(dir.toPath())`, the safe helper available since 1.26.0, which normalizes the resolved path and throws `ArchiveException` when the result would escape the target directory; - a short paragraph after the example explains why entry names must be resolved through `ArchiveEntry.resolveIn(Path)` rather than `Path.resolve(Path)`, and points readers at `Expander` for a ready-made safe extraction API. ## Verification - `javadoc:javadoc`: BUILD SUCCESS, no warnings or errors; - `mvn verify` (includes apache-rat, checkstyle, japicmp): BUILD SUCCESS, no API differences reported. ## Notes for reviewers - Fork PRs on this repository require maintainer approval before CI runs, so the checks will initially sit at `action_required` — this is expected and normal. - An earlier attempt at this fix, [#810](https://github.com/apache/commons-compress/pull/810), was self-closed by its own author on 2026-11-02 ("Closing this to keep my open PRs manageable. Happy to reopen and rebase if maintainers want it.") — it was not rejected. This PR delivers the same fix rebased onto current master. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
