You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2026/09/05 12:15:00 UTC

[jira] [Commented] (CAMEL-24627) camel-file: resolve symlinks when containing local work directory downloads (parity with camel-azure/google-storage)

    [ https://issues.apache.org/jira/browse/CAMEL-24627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18111856#comment-18111856 ] 

Claus Ibsen commented on CAMEL-24627:
-------------------------------------

Fixed in PR https://github.com/apache/camel/pull/26121 (merged to main/4.23.0).

> camel-file: resolve symlinks when containing local work directory downloads (parity with camel-azure/google-storage)
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-24627
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24627
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-file
>            Reporter: Andrea Cosentino
>            Assignee: Andrea Cosentino
>            Priority: Major
>             Fix For: 4.23.0
>
>
> Local work directory downloads in the file-based components (camel-file, camel-ftp/sftp, camel-smb, camel-mina-sftp, camel-azure-files) are contained within the configured localWorkDirectory by GenericFileHelper.jailToLocalWorkDirectory, which currently performs a lexical path-boundary check only.
> CAMEL-24548 / CAMEL-24549 hardened the equivalent containment in camel-azure-storage-blob/datalake and camel-google-storage (AzureFileNameHelper / GoogleCloudStorageFileNameHelper) by additionally resolving existing filesystem path segments (following symbolic links) before checking that the destination stays inside the configured directory.
> GenericFileHelper.jailToLocalWorkDirectory should be brought to parity so that a symbolic link inside the local work directory that resolves outside of it cannot be used to write files elsewhere. Valid nested download paths continue to work unchanged.
> Affected code: components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileHelper.java (jailToLocalWorkDirectory). Callers: FtpOperations, SftpOperations, SmbOperations, MinaSftpOperations, FilesOperations (azure-files).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)