Skip to content

Restrict file transfer URL scheme to http(s) - #392

Merged
D-D-H merged 2 commits into
mainfrom
fix_url_schema
Jul 13, 2026
Merged

Restrict file transfer URL scheme to http(s)#392
D-D-H merged 2 commits into
mainfrom
fix_url_schema

Conversation

@D-D-H

@D-D-H D-D-H commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens file-transfer-by-URL handling to only allow http/https URLs, reducing exposure to local resource disclosure via non-HTTP URL schemes.

Changes:

  • Add DTO-level validation to require an http(s) URL scheme for FileTransferMethod.URL.
  • Add service-level runtime enforcement to reject non-http(s) protocols before opening a connection.
  • Expand tests to cover rejection of file:, jar:, ftp: and acceptance of http(s) URLs.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
server/src/main/java/org/eclipse/jifa/server/domain/dto/FileTransferRequest.java Replaces URL “not blank” validation with an http(s) scheme check.
server/src/main/java/org/eclipse/jifa/server/service/impl/StorageServiceImpl.java Enforces http(s) protocol before opening URL connections.
server/src/test/java/org/eclipse/jifa/server/domain/dto/TestFileTransferRequest.java Adds coverage for rejecting non-http(s) schemes and accepting http(s).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Denghui Dong <denghui.ddh@alibaba-inc.com>
@D-D-H
D-D-H merged commit 444190b into main Jul 13, 2026
5 checks passed
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.

3 participants