Skip to content

Accept only plain and bean-level parameter names in UI actions (6.1.x) - #405

Merged
snoopdave merged 1 commit into
roller-6.1.xfrom
ui-action-param-paths-6.1.x
Nov 29, 2026
Merged

snoopdave merged 1 commit into
roller-6.1.xfrom
ui-action-param-paths-6.1.x

Conversation

@snoopdave

Copy link
Copy Markdown
Contributor

The UI forms post plain parameter names and bean.<field> (plus group.<field> on Planet groups and folder.name on Bookmarks). This limits the rollerStack params interceptor to those shapes.

  • struts.xml: acceptParamNames is ^\w+$,^(bean|group|folder)\.\w+$; other names are ignored.
  • UIActionParameterNamesTest reads the real struts.xml and checks the accepted and ignored shapes.
  • CHANGES.md note for sites that changed the bundled JSPs to post nested names.

Status: JDK 11 full build 898 tests, 0 failures, 1 skipped. I found no nested or indexed names in the JSPs or JS; the UI test jobs are the real check. For 6.1.8 RC4.

The UI forms post plain names and one level into a form bean (plus the
Planet group and Bookmarks folder). Limit the params interceptor in
rollerStack to those shapes and ignore the rest.
@snoopdave
snoopdave requested a review from mraible November 28, 2026 18:52

@mraible mraible 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.

LGTM. I ran it on Jetty with debug logging for the params interceptor and saved Weblog Settings, an entry (tags, category, summary, pinned), a category, a blogroll folder and bookmark, a theme switch, adding and editing a template, the profile, Global Config, a ping target and a Planet subscription. Every value saved. The only names the filter dropped were Global Config's dotted properties, which it reads through HttpParametersAware, and the register page's submit button.

A few small things, none blocking:

  • excludeParams replaces Struts' default exclusions rather than adding to them (Struts logs "Replacing excluded patterns" at startup). That predates this change, but adding the defaults back next to ^action:.*,^method:.* would make them a second layer under the accept list.
  • folder in the accept list doesn't bind anything: Bookmarks.setFolder is private and the rename script posts bean.name. It could come out of the pattern and the CHANGES note.
  • The CHANGES note and the struts.xml comment read as if every other name is ignored, but GlobalConfig and Members still read any name through HttpParametersAware. Saying the filter applies to values bound to action properties would be accurate.
  • UIActionParameterNamesTest checks a hand-picked list. Scanning WEB-INF/jsps for literal name= values on form tags would catch a nested or indexed field added later.
  • Separate from this change: PlanetGroupSubs loads the PlanetGroup entity before the params interceptor runs, so group.* values bind straight onto it. Binding the posted fields to a form bean and copying them over in saveGroup would let group come out of the accept list too.

@snoopdave
snoopdave merged commit ca84e3c into roller-6.1.x Nov 29, 2026
7 checks passed
@snoopdave
snoopdave deleted the ui-action-param-paths-6.1.x branch November 29, 2026 16:14
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