Skip to content

Fix SASL client special characters escaping #2698

@morazow

Description

@morazow

Search before asking

  • I searched in the issues and found nothing similar.

Fluss version

main (development)

Please describe the bug 🐞

When using special characters (e.g, ") in the SASL authentication mechanism, the client SASL parser fails.

For example, a failing test for SaslClientAuthenticator:

@Test
void testSpecialCharactersForPassword() throws Exception {
    final String specialPassword = "pa$$wo\\rd!@#%&\"";
    final Configuration clientConfig = new Configuration();
    clientConfig.setString("client.security.protocol", "sasl");
    clientConfig.setString("client.security.sasl.username", "admin");
    clientConfig.setString("client.security.sasl.password", specialPassword);
    testAuthentication(clientConfig, getDefaultServerConfig());
}

Solution

The first solution would be to properly escape username and password on here: SaslClientAuthenticator.java#L64

In general it would be nice to have utility to escape special characters.

We should check for similar issues on the server side. The fix should introduce proper failing tests for special characters.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions