Skip to content

fix(files_external): add SSRF host validation to external storage backend#41581

Open
DeepDiver1975 wants to merge 2 commits into
masterfrom
security/fix-files-external-ssrf
Open

fix(files_external): add SSRF host validation to external storage backend#41581
DeepDiver1975 wants to merge 2 commits into
masterfrom
security/fix-files-external-ssrf

Conversation

@DeepDiver1975
Copy link
Copy Markdown
Member

Summary

  • UserStoragesController (@NoAdminRequired) accepted arbitrary host values and immediately tested the connection, forcing outbound HTTP to any attacker-specified target
  • No IP range checks, no DNS rebinding protection, no blocklist existed anywhere in the validation chain
  • Fix adds validateHostOption() in StoragesController::validate() blocking private ranges, loopback, link-local, and IPv6 equivalents; admin can opt out via files_external_allow_private_address=true

Security Impact

High — SSRF allowing cloud metadata exfiltration and internal network scanning for any authenticated user when user mounting is enabled

Note

This PR touches StoragesController.php — merge before security/fix-files-external-info-disclosure to avoid conflicts.

Test plan

  • Blocked host tests assert HTTP 403 for loopback/private/link-local targets
  • Allowed host tests confirm legitimate external addresses pass through
  • Run make test TEST_PHP_SUITE=apps/files_external

🤖 Generated with Claude Code

…kend

UserStoragesController::create()/update() (@NoAdminRequired) accepted
arbitrary host values for DAV, SMB, and other network backends without
validating against private IP ranges, loopback, or link-local addresses.
With user mounting enabled, authenticated users could force the server
to make HTTP requests to cloud metadata endpoints (169.254.169.254),
localhost services, or internal network hosts.

Add validateHostOption() to StoragesController::validate(), which blocks
RFC-1918 private ranges, loopback (127.x.x.x / ::1), IPv4 link-local
(169.254.x.x), IPv6 link-local (fe80::/10), and ULA (fc00::/7).
Admin escape-hatch: files_external_allow_private_address=true in config.

Signed-off-by: Thomas Müller <thomas.mueller@owncloud.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@update-docs
Copy link
Copy Markdown

update-docs Bot commented Jun 5, 2026

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
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.

1 participant