[
https://issues.apache.org/jira/browse/KARAF-7326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17471749#comment-17471749
]
ASF GitHub Bot commented on KARAF-7326:
---------------------------------------
jbonofre merged pull request #1485:
URL: https://github.com/apache/karaf/pull/1485
--
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]
> 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)