Skip to content

Protect weblog admins, escape the LDAP comment user name, and limit search queries - #334

Open
mraible wants to merge 5 commits into
roller-6.1.xfrom
weblog-membership-and-search-6.1.x
Open

mraible wants to merge 5 commits into
roller-6.1.xfrom
weblog-membership-and-search-6.1.x

Conversation

@mraible

@mraible mraible commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

The 6.1.x version of the membership, LDAP and search parts of #322. The OIDC identity part isn't included: on 6.1.x the OpenID URL is a field users edit by design.

As on #322, resigning and saving the Members page go through UserManager.updateWeblogMembership(), which locks the weblog's row and applies the change only if an enabled administrator remains, and removing a weblog or user also removes its pending invitations.

WeblogMembershipTest, PermissionTest, LdapCommentAuthenticatorTest, SearchMalformedQueryTest and SearchQueryLengthTest: 10 of the original 23 cases fail without the change. mvn test passes, and the Selenium integration tests pass.

CHANGES entries for the 6.1.8 fixes will come in one PR.

…resigning

Declining a weblog invitation now removes the permission only while it is still pending, so it can no longer remove an accepted membership. Resigning from a weblog is refused, with a message, when the user is the weblog's only admin; pending invitations do not count as another admin.
…bind name

LdapCommentAuthenticator now escapes the submitted user name with Rdn.escapeValue before putting it in the uid part of the bind DN, so characters such as commas, plus signs and equals signs stay part of the user name.
…ing nothing

WeblogSearchRequest and WeblogFeedRequest now keep only the first 256 characters of the q parameter, without splitting a surrogate pair. SearchOperation now catches runtime exceptions that Lucene throws for queries that parse but cannot be built or run, such as an unfinished regular expression or a negative phrase slop. It logs them as a warning and handles them the same way as a query that does not parse.
@mraible mraible changed the title Limit search query length and treat queries Lucene cannot run as finding nothing Protect weblog admins, escape the LDAP comment user name, and limit search queries Nov 18, 2026

@snoopdave snoopdave left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review of 4dc8846b4: The shared changes match #322, apart from the expected javax/jakarta imports. The twin’s federated identity changes are specific to its branch. One membership consistency issue remains.

…ed operation

Resigning from a weblog and saving the Members page now go through UserManager.updateWeblogMembership(), which locks the weblog's row, reads its memberships again, and applies the changes in the same transaction only if an enabled administrator remains. Concurrent membership changes for a weblog therefore run one after the other and can't leave it without an administrator, and a disabled user who holds ADMIN no longer counts as one.
Removing a weblog or a user now also removes its pending invitations, so a weblog or user created later with the same name doesn't inherit them.
@mraible

mraible commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

A second review raised a few more points, now addressed in the latest commits:

  • A disabled user who holds ADMIN no longer counts as the weblog's remaining administrator when resigning or saving members, covered by a new WeblogMembershipTest case.
  • Removing a weblog or a user now also removes its pending invitations, so a weblog or user created again with the same name starts without them; PermissionTest covers both.

@mraible
mraible requested a review from snoopdave November 18, 2026 04:16
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