Repository navigation
Check the salt of multipart posts that Struts couldn't fully parse - #312
Merged
Merged
Conversation
ValidateSaltInterceptor let any multipart post with parse errors through without checking its salt, so that an upload action could report the errors. Struts only gives those errors to upload actions (UploadedFilesAware), though; for any other action the post went on to the action method. Now only upload actions skip the check, and their workflow returns the input page before the action method runs.
snoopdave
reviewed
Nov 18, 2026
snoopdave
left a comment
Contributor
There was a problem hiding this comment.
Review of adc487c63: The change limits the multipart parse-error exception to upload-aware actions. Static review confirmed that Struts 7.4 passes those errors to Roller's workflow before the save methods run, and the new regression test would fail without the fix. No build was run, as requested.
No issues found.
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.
ValidateSaltInterceptorskipped the salt check for a multipart post whenever Struts reported errors parsing it, so an upload action could show those errors. In Struts 7,ActionFileUploadInterceptorcopies the errors only onto actions that implementUploadedFilesAware; for every other action the post binds its parameters and the action method runs. A multipart post with a field longer thanstruts.multipart.maxStringLength, sent to a form action that doesn't take uploads, therefore ran that action without a salt.Now only
UploadedFilesAwareactions (media add and edit, bookmark import) skip the check. Their errors stop the request inworkflow, which returns the input page before the action method runs, as before. Every other action needs a valid salt even when the post has parse errors.ValidateSaltInterceptorTesthas a case for a multipart post with parse errors to an action that isn'tUploadedFilesAware: it now throws and never invokes the action. It fails without the change. The existing case for upload actions now names anUploadedFilesAwareaction.jetty:run, a multipart post toprofile!save.rolwith no salt and a 5,000-character field is now refused, and a bookmark import with the same field shows the "too long" error and imports nothing.mvn testpasses (750 tests), and the Playwright database-login suite passes (20 run, 3 OIDC tests skipped).The
roller-6.1.xline uses Struts 2.5, whose upload interceptor gives parse errors to every action, so this doesn't apply there.