[
https://issues.apache.org/jira/browse/KARAF-7326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17471755#comment-17471755
]
ASF subversion and git services commented on KARAF-7326:
--------------------------------------------------------
Commit f41fda346a37f51702a691aaa152a387156192db in karaf's branch
refs/heads/karaf-4.2.x from Jean-Baptiste Onofré
[ https://gitbox.apache.org/repos/asf?p=karaf.git;h=f41fda3 ]
[KARAF-7326] Add ending slash (separator) in canonical path, avoiding partial
path traversal
(cherry picked from commit 36a2bc430cc773db1cfd0b32e307d9da2d1697f7)
> Fix potential partial path traversal
> ------------------------------------
>
> Key: KARAF-7326
> URL: https://issues.apache.org/jira/browse/KARAF-7326
> Project: Karaf
> Issue Type: Bug
> Components: karaf
> Reporter: Jean-Baptiste Onofré
> Assignee: Jean-Baptiste Onofré
> Priority: Major
>
> In couple of Karaf code, `getCanonicalPath` transforms the path into a
> canonical form preventing such attack types as `..` in path segments. If the
> result of `targetDir.getCanonicalPath()` is not slash terminated it allows
> for partial path traversal.
> Consider `"/usr/outnot".startsWith("/usr/out")`. The check is bypassed
> although it is not the `out` directory.
> The terminating slash may be removed in various places. On Linux `println(new
> File("/var/"))` returns `/var`, but `println(new File("/var", "/"))` -
> `/var/`, however `println(new File("/var", "/").getCanonicalPath())` - `/var`.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)