Skip to content

fix(files_external): sanitize exception messages in storage status response#41585

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

fix(files_external): sanitize exception messages in storage status response#41585
DeepDiver1975 wants to merge 2 commits into
masterfrom
security/fix-files-external-info-disclosure

Conversation

@DeepDiver1975
Copy link
Copy Markdown
Member

Summary

  • The \Exception catch block in updateStorageStatus() returned raw exception messages (including Guzzle cURL error 7: Failed to connect to 10.0.0.x) in the JSON statusMessage field
  • Authenticated users with storage access could use connection error differences to map internal network topology (SSRF oracle)
  • Fix: log full exception server-side; return generic l10n string to client

Security Impact

Medium — internal network reconnaissance oracle for authenticated users with external storage access

Note

This PR touches StoragesController.php — merge security/fix-files-external-ssrf first to avoid conflicts.

Test plan

  • testUpdateStorageStatusDoesNotLeakExceptionDetailsInStatusMessage asserts IP addresses and exception class names do not appear in statusMessage; fails without fix
  • Run make test TEST_PHP_SUITE=apps/files_external

🤖 Generated with Claude Code

…sponse

The catch-all Exception handler in updateStorageStatus() set the
storage statusMessage to get_class($e).": ".$e->getMessage(), which
for Guzzle/cURL exceptions includes the resolved IP, port, and cURL
error code. This created an internal network oracle: authenticated
users with external storage access could distinguish "connection
refused" from "timed out" from "no DNS" to map internal topology.

Log the full exception server-side and return a generic l10n string
to the client instead.

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