Skip to content

Backport pr 1159 (Fixed: Add file path verifications to Webtools Entity Import/Export and improve redirection checks for URL DataResources)#1160

Merged
jacopoc merged 2 commits into
apache:release24.09from
jacopoc:backport-pr-1159
May 4, 2026
Merged

Backport pr 1159 (Fixed: Add file path verifications to Webtools Entity Import/Export and improve redirection checks for URL DataResources)#1160
jacopoc merged 2 commits into
apache:release24.09from
jacopoc:backport-pr-1159

Conversation

@jacopoc
Copy link
Copy Markdown
Contributor

@jacopoc jacopoc commented May 4, 2026

Backport PR #1159

jacopoc added 2 commits May 4, 2026 12:54
…CE path

renderDataResourceAsText() validated the initial URL via checkUrlResourceAllowed() but then fetched it with url.openStream(), which follows HTTP redirects by default.

The fix aligns this code path with the already-hardened getDataResourceStream() path: open a URLConnection, disable redirect following with setInstanceFollowRedirects(false), reject any 3xx response, and apply the same configurable connect/read timeouts and response-size cap (BoundedInputStream) used elsewhere.

(cherry picked from commit a8d0eba)
…portAll

Paths in both methods are now guarded by SecurityUtil.checkOfbizFileAllowList(), which restricts paths to the directories configured in content.data.ofbiz.file.allowed.paths (security.properties).

(cherry picked from commit 15c1956)
@jacopoc jacopoc self-assigned this May 4, 2026
@jacopoc jacopoc merged commit 3965d65 into apache:release24.09 May 4, 2026
5 checks passed
@jacopoc jacopoc deleted the backport-pr-1159 branch May 4, 2026 11:14
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