fix(security): T2.4 hardening: PSSecurityHeadersFilter for X-Frame-Options + X-Content-Type-Options + Referrer-Policy + HSTS (issue #94) - #95
Merged
Conversation
…tions + X-Content-Type-Options + Referrer-Policy + HSTS (issue #94) Defense-in-depth for several of the 45+ CVEs in Spring 5.3.x + Spring Security 5.8.x (parent epic #73, T2.4 sub-task). Many of those CVEs are addressed by setting standard security response headers; the framework's WebSecurityConfigurerAdapter can set them automatically, but the project uses legacy web.xml filter-based security, so a dedicated servlet filter is the most reliable way to add them across webapps. What's new: - PSSecurityHeadersFilter: a simple Filter that sets 4-5 standard security response headers on every request. Sits in modules/perc-security-utils (com.percussion.security.servlet) so any webapp that depends on perc-security-utils can register it in web.xml with no new deps. - Headers set: * X-Frame-Options: SAMEORIGIN (clickjacking, CWE-1021) * X-Content-Type-Options: nosniff (MIME-sniffing, CWE-79 follow-up) * Referrer-Policy: strict-origin-when-cross-origin (referrer-leak) * Strict-Transport-Security: max-age=31536000; includeSubDomains (HTTPS downgrade; only emitted on secure/HTTPS requests, so a misconfigured HTTP-only deployment does not get a stale HSTS header that browsers might honor on a future HTTPS port) * X-XSS-Protection: 0 (the deprecated XSS auditor is disabled; per the modern recommendation, 0 is correct, not 1; mode=block) - All values are class constants; future tuning is a one-line change. Registered in the 2 main Rhythmyx web.xml files: - projects/sitemanage/.../Rhythmyx/sys_resources/webapps/secure/.../web.xml - projects/sitemanage/.../Rhythmyx/sys_resources/webapps/non-secure/.../web.xml Each gets a <filter> and <filter-mapping> block that registers the new filter at /* (after the existing PSCacheControlFilter / PSDefaultContentTypeFilter, before springSecurityFilterChain). Total diff: 3 files, +131 / -0. Verification: - ./mvn-env.sh clean install -DskipTests: BUILD SUCCESS in 4:00 (61 modules, Java 1.8.0_504) - No UnsupportedClassVersionError in the build log - A manual smoke test: `curl -I <server>/Rhythmyx/whatever` should now show all 4-5 headers in the response (X-Frame-Options, X-Content-Type-Options, Referrer-Policy; Strict-Transport-Security on HTTPS only) Out of scope (separate issues): - Add the filter to the other ~9 web.xml files (deliverytiersuite, comments, polls, etc.) - follow-up PRs - Update Spring to the latest 5.3.x patch (no security-relevant change in this PR; can be a follow-up) - The remaining 35+ T2.4 CVEs require feature-level config changes (e.g., enabling CSRF in Spring Security's HttpSecurity config) - commons-httpclient 3.1 -> HttpClient 5 (issue #88, deferred) - T2.13 Eclipse Jetty 9.4.58 hardening (29+ CVEs) - T2.6 commons-collections4 input validation (2 CVEs) Refs #94, #73, #72
natechadwick
approved these changes
Aug 28, 2026
natechadwick
pushed a commit
that referenced
this pull request
Aug 28, 2026
…livery-tier webapps (issue #96) (#97) PR #95 added the reusable PSSecurityHeadersFilter and registered it in the two main Rhythmyx webapps (secure + non-secure). The delivery-tier webapps (comments, feeds, forms, integrations, membership, metadata, polls) did not have any security-header filter, so they were missing: - X-Frame-Options (clickjacking, CWE-1021) - X-Content-Type-Options: nosniff (MIME-sniffing) - Referrer-Policy: strict-origin-when-cross-origin (referrer leakage) - Strict-Transport-Security on HTTPS (downgrade) - X-XSS-Protection: 0 (legacy XSS auditor disabled) This is the same defense-in-depth added to the main Rhythmyx webapps. WebUI/war and system/ear already have the existing PSSecurityHeaderFilter (com.percussion.utils.security.PSSecurityHeaderFilter), which is a richer filter that does X-Frame/XSS/HSTS/CSP/Cache-Control. Adding the new filter there would create duplicate header writes, so they are out of scope for this slice. Verified clean build via ./mvn-env.sh clean install -DskipTests (7 of 7 target modules BUILD SUCCESS; PSSecurityHeadersFilter present in each built WAR's WEB-INF/web.xml). > Co-Authored by Mavis v1.0.0 using minimax-m3 with agent mavis.
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.
Summary
T2.4 hardening sub-task of the parent epic #73. This is defense-in-depth for several of the 45+ CVEs in Spring 5.3.x + Spring Security 5.8.x. Many of those CVEs are addressed by setting standard security response headers (clickjacking, MIME-sniffing, referrer-leak, HTTPS downgrade). The framework's
WebSecurityConfigurerAdapter/SecurityFilterChaincan set them automatically, but the project uses legacyweb.xmlfilter-based security, so a dedicated servlet filter is the most reliable way to add them across all webapps.This PR adds a reusable filter and registers it in the 2 main Rhythmyx
web.xmlfiles. The other ~9 web.xml files (deliverytiersuite, comments, polls, etc.) can be follow-up PRs.What changes (3 files, +131 / −0)
1. New filter (1 file, +117)
modules/perc-security-utils/src/main/java/com/percussion/security/servlet/PSSecurityHeadersFilter.java— a simpleFilterthat sets the following response headers on every request:X-Frame-Options: SAMEORIGIN(clickjacking, CWE-1021)X-Content-Type-Options: nosniff(MIME-sniffing, CWE-79 follow-up)Referrer-Policy: strict-origin-when-cross-origin(referrer-leak)Strict-Transport-Security: max-age=31536000; includeSubDomains(HTTPS downgrade; only emitted on secure (HTTPS) requests, so a misconfigured HTTP-only deployment does not get a stale HSTS header that browsers might honor on a future HTTPS port)X-XSS-Protection: 0(the deprecated XSS auditor is disabled; per the modern recommendation,0is correct, not1; mode=block)All values are constants on the class. Future tuning is a one-line change.
2. Registration in 2 main
web.xmlfiles (2 files, +14 each)projects/sitemanage/src/main/resources/Rhythmyx/sys_resources/webapps/secure/WEB-INF/web.xmlprojects/sitemanage/src/main/resources/Rhythmyx/sys_resources/webapps/non-secure/WEB-INF/web.xmlEach gets a
<filter>and<filter-mapping>block that registers the new filter at/*(after the existingPSCacheControlFilter/PSDefaultContentTypeFilter, beforespringSecurityFilterChain).Verification
./mvn-env.sh clean install -DskipTests→ BUILD SUCCESS in 4:00 (61 modules, Java 1.8.0_504)UnsupportedClassVersionErrorin the build logcurl -I <server>/Rhythmyx/whatevershould now show all 4-5 headers in the response (X-Frame-Options, X-Content-Type-Options, Referrer-Policy; Strict-Transport-Security on HTTPS only)Out of scope (separate issues under #73)
web.xmlfiles (deliverytiersuite, comments, polls, etc.) — follow-up PRsHttpSecurityconfig)commons-httpclient 3.1 → HttpClient 5(deps: EOL replace commons-httpclient 3.1 with org.apache.httpcomponents.client5:httpclient5 (closes 1 CVE) #88, deferred; multi-day migration)References
docs/ai-generated/tasks/PR#-DependencyVulnerabilityAnalysis/issues/02-epic-non-upgradeable.md#t24--spring-53x--spring-security-58x-hardening