Skip to content

Added a filter for framable resources. - #12779

Open
axl8713 wants to merge 1 commit into
masterfrom
framing-filter
Open

Added a filter for framable resources.#12779
axl8713 wants to merge 1 commit into
masterfrom
framing-filter

Conversation

@axl8713

@axl8713 axl8713 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Description

Not all the resources exposed from MapStore should be framable, so this filter limits framing to same-origin requests where appropriate.

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe: Application container deployment change (web.xml)

Issue

What is the current behavior?

#

What is the new behavior?

Breaking change

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • Yes, and I documented them in migration notes
  • No

Other useful information

@cla-bot cla-bot Bot added the CLA Ready label Aug 7, 2026
@axl8713
axl8713 requested a review from offtherailz August 7, 2026 11:57
@tdipisa tdipisa modified the milestones: 2026.02.01, 2026.03.00 Aug 10, 2026

@offtherailz offtherailz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Apply the same suggested in the main web.xml to the template one of course.


<filter>
<filter-name>viewFramingFilter</filter-name>
<filter-class>org.apache.catalina.filters.HttpHeaderSecurityFilter</filter-class>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a tomcat only filter. "org.apache.catalina.filters."
Not sure it should be used ... We are using only tomcat right now. So not sure if we can skip, maybe is not blocking

</filter-mapping>
<filter-mapping>
<filter-name>viewFramingFilter</filter-name>
<url-pattern>/configs/*</url-pattern>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What does this really covers? JSON are not "embeddable". I think it will never be applied so it doesn't protect from any issues. I think this was a false interception of something, by AI

Comment on lines +97 to +102
<filter-name>viewFramingFilter</filter-name>
<!-- FORWARD is required: / is resolved to index.html through an internal forward -->
<url-pattern>/</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This mapping never matches: the filter is applied to / by the /index.html mapping below, not by this one, and the FORWARD dispatcher is not involved either.

@offtherailz offtherailz assigned axl8713 and unassigned axl8713 and offtherailz Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants