Apache Commons VFS: Possible path traversal issue when using NameScope.DESCENDENT
Apache Software Foundation Apache Commons VFS
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| org.apache.commons:commons-vfs2 Maven |
|
|
Original description
Relative Path Traversal vulnerability in Apache Commons VFS before 2.10.0.
The FileObject API in Commons VFS has a 'resolveFile' method that takes a 'scope' parameter. Specifying 'NameScope.DESCENDENT' promises that "an exception is thrown if the resolved file is not a descendent of the base file". However, when the path contains encoded ".." characters (for example, "%2E%2E/bar.txt"), it might return file objects that are not a descendent of the base file, without throwing an exception. This issue affects Apache Commons VFS: before 2.10.0.
Users are recommended to upgrade to version 2.10.0, which fixes the issue.