Skip to content

fix: insecure default behavior in SslClientAuth.forConfig#21888

Open
zendy199x wants to merge 1 commit intoapache:trunkfrom
zendy199x:fix/insecure-default-behavior-in-sslclientauth-forconf
Open

fix: insecure default behavior in SslClientAuth.forConfig#21888
zendy199x wants to merge 1 commit intoapache:trunkfrom
zendy199x:fix/insecure-default-behavior-in-sslclientauth-forconf

Conversation

@zendy199x
Copy link
Copy Markdown

Delete this text and replace it with a detailed description of your change. The
PR title and body will become the squashed commit message.

If you would like to tag individuals, add some commentary, upload images, or
include other supplemental information that should not be part of the eventual
commit message, please use a separate comment.

If applicable, please include a summary of the testing strategy (including
rationale) for the proposed change. Unit and/or integration tests are expected
for any behavior change and system tests should be considered for larger
changes.

fix: insecure default behavior in SslClientAuth.forConfig

The forConfig method returns null when an invalid configuration key is provided, instead of throwing an exception or using a default value. This could lead to unexpected behavior or misconfiguration in SSL client authentication settings, where a null value might be silently ignored or cause downstream failures. It's a security risk because misconfigured SSL settings could weaken the security posture.

Suggestion: Throw an IllegalArgumentException or return a default value (e.g., SslClientAuth.NONE) when the input key is invalid, ensuring that misconfigurations are caught early and explicitly handled.

Files changed:

  • clients/src/main/java/org/apache/kafka/common/config/SslClientAuth.java (modified)
    Commit message: fix(security): insecure default behavior in sslclientauth.forconfig

Copilot AI review requested due to automatic review settings March 28, 2026 17:29
@github-actions github-actions bot added triage PRs from the community clients small Small PRs labels Mar 28, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates SSL client-auth configuration parsing to avoid returning null for unrecognized values.

Changes:

  • Change SslClientAuth.forConfig to return SslClientAuth.NONE instead of null when the key does not match any known enum value.

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

- update clients/src/main/java/org/apache/kafka/common/config/SslClientAuth.java
- address 1 review comment(s)

Signed-off-by: Zendy <50132805+zendy199x@users.noreply.github.com>
@zendy199x zendy199x force-pushed the fix/insecure-default-behavior-in-sslclientauth-forconf branch from 24ae0f7 to 2bbe3d5 Compare March 28, 2026 18:25
@github-actions github-actions bot removed the triage PRs from the community label Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants