Skip to content

Do not log ABCA client authentication headers - #53484

Merged
mposolda merged 1 commit into
keycloak:mainfrom
wakqasahmed:fix/issue-52508-abca-no-header-logging
Nov 5, 2026
Merged

mposolda merged 1 commit into
keycloak:mainfrom
wakqasahmed:fix/issue-52508-abca-no-header-logging

Conversation

@wakqasahmed

Copy link
Copy Markdown
Contributor

Closes #52508

AttestationBasedClientAuthenticator.authenticateClient() logged the full OAuth-Client-Attestation and OAuth-Client-Attestation-PoP header values at DEBUG before validating them. Those are signed JWTs used as client credentials, so anyone with access to DEBUG logs could lift a working pair. The values were also concatenated into the debugf format string, which is a format-string misuse on its own.

This removes the two log statements. I didn't replace them with a metadata log: the sub and jti suggested in the issue are only available after the JWTs are parsed, and the validation code that does that already reports failures through ServicesLogger.LOGGER.errorValidatingAssertion. Happy to add a post-validation sub/jti debug line if you'd prefer one.

Same idea as #53395 for the SPNEGO token. The similar logging in the OID4VCI code (#52509) is left for a separate change.

I did not add a test: asserting on server DEBUG output would need a full integration run for a pure deletion of two statements, and I couldn't build the services module on my machine, so I'm relying on CI for the compile.

I used an AI agent (Claude Code) to help with this change.

@wakqasahmed
wakqasahmed requested a review from a team as a code owner October 2, 2026 23:38
Copilot AI balanced review requested due to automatic review settings October 2, 2026 23:38

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.

Copilot review overview

🟢 Approval recommended

The focused deletion removes credential exposure without changing validation or control flow.

Review effort: Balanced
Findings: None

What changed in this PR

Addresses #52508 by removing DEBUG logging of ABCA client credentials without changing authentication behavior.

Changes:

  • Removes both log statements that expose signed attestation headers and misuse debugf format strings.
File Description
services/​src/​main/​java/​org/​keycloak/​authentication/​authenticators/​client/​AttestationBasedClientAuthenticator.java Removes credential-bearing DEBUG logs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@dominikschlosser dominikschlosser 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.

LGTM

The Attestation-Based Client Authenticator wrote the full
OAuth-Client-Attestation and OAuth-Client-Attestation-PoP header values
to the DEBUG log before validating them. These are signed JWTs used as
client credentials, so remove those statements.

Closes keycloak#52508

Signed-off-by: wakqasahmed <wakqasahmed@gmail.com>
@mposolda
mposolda force-pushed the fix/issue-52508-abca-no-header-logging branch from 22560b4 to f76286b Compare November 5, 2026 11:01
Copilot AI balanced review requested due to automatic review settings November 5, 2026 11:01
@mposolda mposolda self-assigned this Nov 5, 2026

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.

🟢 Approval recommended

No active review issues remain for the change removing credential-bearing DEBUG logs.

No open issues 🎉

Review effort: Balanced

@mposolda

mposolda commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

@wakqasahmed @dominikschlosser Thanks for the PR and review!

@mposolda
mposolda merged commit e0b49a7 into keycloak:main Nov 5, 2026
96 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ABCA] Debug logging exports reusable ABCA client-authentication headers

4 participants