Skip to content

update ldap strings#21764

Open
CL-Andrew wants to merge 1 commit intodevelopfrom
ldapupdate
Open

update ldap strings#21764
CL-Andrew wants to merge 1 commit intodevelopfrom
ldapupdate

Conversation

@CL-Andrew
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings March 27, 2026 23:53
@CL-Andrew CL-Andrew requested review from a team as code owners March 27, 2026 23:53
@github-actions
Copy link
Copy Markdown
Contributor

👋 CL-Andrew, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions
Copy link
Copy Markdown
Contributor

✅ No conflicts with other open PRs targeting develop

@github-actions
Copy link
Copy Markdown
Contributor

I see you updated files related to core. Please run make gocs in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

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

Risk Rating: MEDIUM — touches authentication/bind behavior; small diff but can impact logins for certain valid usernames.

Updates LDAP DN escaping used when constructing the bind DN for user authentication in the LDAP auth provider.

Changes:

  • Switch from ldap.EscapeFilter(...) to ldap.EscapeDN(...) when building the user bind DN in CreateSession.
  • Switch from ldap.EscapeFilter(...) to ldap.EscapeDN(...) when building the user bind DN in TestPassword.

Comment on lines 405 to 409
// Attempt to LDAP Bind with user provided credentials
escapedEmail := ldap.EscapeFilter(strings.ToLower(sr.Email))
escapedEmail := ldap.EscapeDN(strings.ToLower(sr.Email))
searchBaseDN := fmt.Sprintf("%s=%s,%s,%s", l.config.BaseUserAttr(), escapedEmail, l.config.UsersDN(), l.config.BaseDN())
if err = conn.Bind(searchBaseDN, sr.Password); err != nil {
l.lggr.Infof("Error binding user authentication request in LDAP Bind: %v", err)
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

escapedEmail is now produced via ldap.EscapeDN(...) for use in the bind DN. Ensure this DN-escaped value is not reused later as the logical user email (e.g., passed into FindUser / used for local DB lookups), because DN escaping can change valid emails (notably + in plus-addressing) and will cause user/group lookup to fail. Keep separate variables: normalized email for identity/DB and DN-escaped value solely for building the bind DN.

Copilot uses AI. Check for mistakes.
@cl-sonarqube-production
Copy link
Copy Markdown

@trunk-io
Copy link
Copy Markdown

trunk-io bot commented Mar 28, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

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.

2 participants