Skip to content

fix(federation): remove plaintext auth token from error log in getSharedSecret#41578

Open
DeepDiver1975 wants to merge 2 commits into
masterfrom
security/fix-federation-token-in-log
Open

fix(federation): remove plaintext auth token from error log in getSharedSecret#41578
DeepDiver1975 wants to merge 2 commits into
masterfrom
security/fix-federation-token-in-log

Conversation

@DeepDiver1975
Copy link
Copy Markdown
Member

Summary

  • getSharedSecret (@publicpage) logged both the submitted and expected tokens in plaintext on failure: got "X" but expected "Y"
  • Any unauthenticated attacker who knows a trusted server URL could trigger this log entry at will, harvesting the valid token from logs
  • Fix removes the getToken() DB call that existed only to populate the log, replacing the message with a generic non-disclosing string

Security Impact

Medium — requires secondary log-read access to exploit; unauthenticated trigger

Note

This PR touches the same file as security/fix-federation-token-oracle — merge that one first to avoid conflicts.

Test plan

  • testGetSharedSecretDoesNotLogTokenValues asserts neither attacker nor stored token appears in the logged string; fails without fix
  • Run make test TEST_PHP_SUITE=apps/federation

🤖 Generated with Claude Code

…redSecret

When getSharedSecret received an invalid token it logged both the
attacker-supplied token and the expected valid token in plaintext:
'got "X" but expected "Y"'. Since the endpoint is @publicpage, any
unauthenticated caller could trigger this log entry at will for any
trusted server URL, potentially exposing the valid federation token
to anyone with log-read access.

Remove the dbHandler->getToken() call that existed solely to populate
the log message, and replace the message with a non-disclosing string.

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