[ 
https://issues.apache.org/jira/browse/CAMEL-27453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Federico Mariani resolved CAMEL-27453.
--------------------------------------
    Resolution: Fixed

Fixed on main (4.24.0), camel-4.22.x and camel-4.18.x: 
https://github.com/apache/camel/pull/30679, 
https://github.com/apache/camel/pull/30680, 
https://github.com/apache/camel/pull/30681. The 4.22.4 and 4.18.7 fix versions 
will be added once they exist in JIRA.

> camel-file - starting directory check: normalize paths without special 
> prefixes
> -------------------------------------------------------------------------------
>
>                 Key: CAMEL-27453
>                 URL: https://issues.apache.org/jira/browse/CAMEL-27453
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-file, camel-ftp
>            Reporter: Federico Mariani
>            Priority: Major
>             Fix For: 4.24.0
>
>
> The starting directory check (jailStartingDirectory) of the remote-file 
> consumers and of the file producers normalizes the path with 
> FileUtil.compactPath. That general-purpose helper gives some leading prefixes 
> a special meaning. For an endpoint without a directory, which works in the 
> login directory, this normalization does not match how the FTP client and the 
> server resolve the path.
> Change:
> - Add a lexical normalization to GenericFileHelper that is used only by the 
> starting directory check. It treats every path segment alike, without special 
> handling of any prefix.
> - GenericFileHelper.isWithinDirectory refuses a target that still has a 
> parent-directory segment after normalization.
> - Use both in RemoteFileConsumer.isWithinStartingDirectory, 
> GenericFileProducer (jailStartingDirectory check) and SmbConsumer.
> FileUtil.compactPath and the local work directory check are not changed.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to