Skip to content

BUG/MINOR: Prevent user addition with whitespace in password hash - #792

Open
markkrj wants to merge 2 commits into
haproxytech:masterfrom
markkrj:fix-user-password
Open

BUG/MINOR: Prevent user addition with whitespace in password hash#792
markkrj wants to merge 2 commits into
haproxytech:masterfrom
markkrj:fix-user-password

Conversation

@markkrj

@markkrj markkrj commented Mar 6, 2026

Copy link
Copy Markdown

If password hash contains whitespace of any kind, haproxy fails to validate the config and will not start or reload.

According to man 5 crypt:

Hashed passphrases are always entirely printable ASCII, and do not contain any whitespace or the characters
     ‘:’, ‘;’, ‘*’, ‘!’, or ‘\’.

I don't know if it must be this controller's job to validate all of that. But, whitespace in the password does brake it from generating valid HAProxy config, so that is a bug.
Also, I think that emitting a warning is helpful for admins to figure out why some user cannot login.

/cc @ivanmatmati: I talked to you on Slack
/cc @hdurand0710: You fixed a bug related

@stale

stale Bot commented Apr 11, 2026

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale label Apr 11, 2026
@oktalz oktalz added enhancement New feature or request and removed stale labels Apr 15, 2026
@markkrj markkrj changed the title BUG/MINOR: Prevent user addition with whitespace in password BUG/MINOR: Prevent user addition with whitespace in password hash Aug 2, 2026
@oktalz
oktalz force-pushed the fix-user-password branch from e265c35 to 18f9085 Compare August 14, 2026 09:23
If password contains whitespace of any kind, haproxy fails to validate
the config and will not start or reload
@oktalz
oktalz force-pushed the fix-user-password branch from 18f9085 to 7713940 Compare August 26, 2026 11:10
Comment thread pkg/annotations/ingress/basicAuth.go Outdated
@oktalz

oktalz commented Aug 26, 2026

Copy link
Copy Markdown
Member

hi @markkrj
thx for this, it founds some things we need to change additionally, I think different warning message would be ok here and I can deal with rest of things I found

…words

The ingress controller would panic when auth-type/auth-secret are
confgured through ConfigMap.
Secret name and namespace was added to the message to enhance context.
@markkrj

markkrj commented Sep 1, 2026

Copy link
Copy Markdown
Author

@oktalz What do you think of this approach?
In an incorrect config, the log will be flooded, but also, it took me some time to find the offender when my IC crashed.
This way, the admin would immediately tell which ingress/secret is wrong.

@markkrj
markkrj requested a review from oktalz September 1, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants