Skip to content

fix: fixes parsing of dex passwords with dollar sign#28027

Open
ppapapetrou76 wants to merge 3 commits into
argoproj:masterfrom
ppapapetrou76:issue-27803-fix-dex-ldap-pwd-parsing-dollar-sign
Open

fix: fixes parsing of dex passwords with dollar sign#28027
ppapapetrou76 wants to merge 3 commits into
argoproj:masterfrom
ppapapetrou76:issue-27803-fix-dex-ldap-pwd-parsing-dollar-sign

Conversation

@ppapapetrou76
Copy link
Copy Markdown
Contributor

@ppapapetrou76 ppapapetrou76 commented May 27, 2026

Closes #27803

Addresses a dex password issue when it contains the dollar sign which was leading to login failures - see details in the linked issue

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Title of the PR
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

@bunnyshell
Copy link
Copy Markdown

bunnyshell Bot commented May 27, 2026

🔴 Preview Environment stopped on Bunnyshell

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🔵 /bns:start to start the environment
  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment

Comment thread util/settings/settings.go Fixed
@ppapapetrou76 ppapapetrou76 force-pushed the issue-27803-fix-dex-ldap-pwd-parsing-dollar-sign branch from 1ac46a3 to 78c0c4f Compare May 27, 2026 16:17
Signed-off-by: Patroklos Papapetrou <ppapapetrou76@gmail.com>
@ppapapetrou76 ppapapetrou76 force-pushed the issue-27803-fix-dex-ldap-pwd-parsing-dollar-sign branch from 78c0c4f to 02a37d0 Compare May 27, 2026 16:17
@ppapapetrou76 ppapapetrou76 marked this pull request as ready for review May 27, 2026 16:45
@ppapapetrou76 ppapapetrou76 requested a review from a team as a code owner May 27, 2026 16:45
@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.60%. Comparing base (69e6f94) to head (b6d1a3c).
⚠️ Report is 22 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #28027      +/-   ##
==========================================
+ Coverage   64.49%   64.60%   +0.11%     
==========================================
  Files         422      423       +1     
  Lines       58106    58244     +138     
==========================================
+ Hits        37473    37630     +157     
+ Misses      17114    17098      -16     
+ Partials     3519     3516       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread util/settings/settings_test.go Outdated
assert.Equal(t, "spaced$$pass", result["bindPW"])
})

t.Run("non-reference string value is returned as-is", func(t *testing.T) {
Copy link
Copy Markdown
Member

@nitishfy nitishfy May 28, 2026

Choose a reason for hiding this comment

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

Is this intentional behaviour here? If a user puts bindPW: "test$test" in dex.config with no $key reference, the usre is still going to hit the original bug.

EDIT: We should try to escape $ for every string in post-substituion dexCfg and not just resolve references.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks @nitishfy - yes it was intentionally but probably I was wrong 😄
Thanks for catching this - I have updated the PR changes to also escape both references and passwords.

My initial though was that in real world scenarios only secrete references are used and not passwords

Fell free to re-review when you have time

Signed-off-by: Patroklos Papapetrou <ppapapetrou76@gmail.com>
Signed-off-by: Patroklos Papapetrou <ppapapetrou76@gmail.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.

Dex LDAP password with '$' causes 41 authentication - probably parsing error

3 participants