Skip to content

Fixed: Improve file path validation to work with mounted directories#1151

Merged
jacopoc merged 1 commit into
apache:release24.09from
jacopoc:release/fix-file-path-checks-for-mounted-filesystems
May 5, 2026
Merged

Fixed: Improve file path validation to work with mounted directories#1151
jacopoc merged 1 commit into
apache:release24.09from
jacopoc:release/fix-file-path-checks-for-mounted-filesystems

Conversation

@jacopoc

@jacopoc jacopoc commented May 1, 2026

Copy link
Copy Markdown
Contributor

File.getCanonicalPath() resolves all symlinks in a path. OS-level mount points (Docker bind mounts, EFS) appear as symlinks. When a subdirectory like runtime/ is mounted, a file's canonical path resolves to the mount target (e.g. /mnt/efs/data/file.pdf), which no longer shares a prefix with the canonical path of ofbiz.home (/opt/ofbiz)

(cherry picked from commit b3eadf1)

File.getCanonicalPath() resolves all symlinks in a path. OS-level mount points (Docker bind mounts, EFS) appear as symlinks. When a subdirectory like runtime/ is mounted, a file's canonical path resolves to the mount target (e.g. /mnt/efs/data/file.pdf), which no longer shares a prefix with the canonical path of ofbiz.home (/opt/ofbiz)

(cherry picked from commit b3eadf1)
@jacopoc jacopoc self-assigned this May 1, 2026
@jacopoc jacopoc merged commit d094e5a into apache:release24.09 May 5, 2026
5 checks passed
@jacopoc jacopoc deleted the release/fix-file-path-checks-for-mounted-filesystems branch May 5, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant