Repository navigation
WW-5846 Match exemptedPaths against the request path in FetchMetadata, COOP and COEP interceptors (6.x) - #2125
Merged
Conversation
FetchMetadataInterceptor, CoopInterceptor and CoepInterceptor compared each exemptedPaths entry with the context path, which is the same for every request: an entry naming a path never matched, and an entry equal to the context path exempted the whole application. They now compare against RequestUtils.getUri(request), the value the action mapper uses: servlet path plus path info, or the included servlet path during an include dispatch. Matching is exact, so an entry includes the action extension, e.g. /saml/acs.action. The Fetch Metadata rejection log names the request path, which is the value to add to exemptedPaths. Tests now set the servlet path instead of faking a context path, and the struts-testing.xml fixtures use the paths a real request carries. BREAKING CHANGE: an exemptedPaths entry equal to the context path no longer disables the interceptor for the whole application; use the interceptor's "disabled" parameter instead. Entries naming a request path now take effect. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lukaszlenart
marked this pull request as ready for review
November 7, 2026 17:46
|
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.



Backport of PR #2124 to
support/struts-6-x-xfor 6.13.0. Conflicts were import-only (com.opensymphony.xwork2/javax.servleton 6.x).Fixes WW-5846
Summary
FetchMetadataInterceptor,CoopInterceptorandCoepInterceptorcompared eachexemptedPathsentry withrequest.getContextPath(), which is the same for every request. An entry naming a path never matched; an entry equal to the context path exempted the whole application.They now compare against
RequestUtils.getUri(request), the valueDefaultActionMapperuses since WW-5842: servlet path plus path info, or the included servlet path during an include dispatch./saml/acs.action, not/saml/acs. Apps serving an action under several extensions list each form; an unlisted form stays protected. No prefix or wildcard entries for now.exemptedPaths.CoopInterceptor.isExempted(String)keeps its signature.This gives applications affected by WW-5753 / WW-5754 (cross-site POST navigations rejected: SAML/OIDC
form_post, payment returns) a working per-path opt-out alongside the per-action<param name="fetchMetadata.disabled">true</param>.Breaking change
exemptedPathsentry equal to the context path no longer disables the interceptor app-wide. Use the interceptor'sdisabledparameter instead.Goes into the 7.5.0 / 6.13.0 Version Notes and Migration Guide; the struts-site interceptor pages are updated in a separate PR.
Test plan
struts-testing.xmlfixtures rewritten to set the servlet path (with.action) instead of faking a context pathmvn test -DskipAssembly -pl core,plugins/rest,plugins/bean-validation— onsupport/struts-6-x-x: 2764 / 93 / 23 tests, 0 failures🤖 Generated with Claude Code