Repository navigation
Accept only plain and bean-level parameter names in UI actions (6.1.x) - #405
Merged
Merged
Conversation
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.
mraible
approved these changes
Nov 29, 2026
mraible
left a comment
Contributor
There was a problem hiding this comment.
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:
excludeParamsreplaces 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.folderin the accept list doesn't bind anything:Bookmarks.setFolderis private and the rename script postsbean.name. It could come out of the pattern and the CHANGES note.- The CHANGES note and the
struts.xmlcomment read as if every other name is ignored, but GlobalConfig and Members still read any name throughHttpParametersAware. Saying the filter applies to values bound to action properties would be accurate. UIActionParameterNamesTestchecks a hand-picked list. ScanningWEB-INF/jspsfor literalname=values on form tags would catch a nested or indexed field added later.- Separate from this change:
PlanetGroupSubsloads thePlanetGroupentity before the params interceptor runs, sogroup.*values bind straight onto it. Binding the posted fields to a form bean and copying them over insaveGroupwould letgroupcome out of the accept list too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The UI forms post plain parameter names and
bean.<field>(plusgroup.<field>on Planet groups andfolder.nameon Bookmarks). This limits therollerStackparams interceptor to those shapes.struts.xml:acceptParamNamesis^\w+$,^(bean|group|folder)\.\w+$; other names are ignored.UIActionParameterNamesTestreads the realstruts.xmland checks the accepted and ignored shapes.CHANGES.mdnote 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.