Skip to content

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

Merged
jacopoc merged 2 commits into
apache:trunkfrom
jacopoc:improve-redirection-checks
May 4, 2026
Merged

Fixed: Add file path verifications to Webtools Entity Import/Export and improve redirection checks for URL DataResources#1159
jacopoc merged 2 commits into
apache:trunkfrom
jacopoc:improve-redirection-checks

Conversation

@jacopoc
Copy link
Copy Markdown
Contributor

@jacopoc jacopoc commented May 4, 2026

Many thanks to icysun (icysun@qq.com) for the thorough analysis and valuable suggestions to improve the robustness of Entity data import/export processing and URL DataResource rendering.

jacopoc added 2 commits May 4, 2026 11:56
…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.
…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).
@jacopoc jacopoc self-assigned this May 4, 2026
@jacopoc jacopoc merged commit 15c1956 into apache:trunk May 4, 2026
5 checks passed
@jacopoc jacopoc deleted the improve-redirection-checks branch May 4, 2026 10:48
@icysun
Copy link
Copy Markdown

icysun commented May 14, 2026

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants