Skip to content

fix(security): T2.4 hardening: PSSecurityHeadersFilter for X-Frame-Options + X-Content-Type-Options + Referrer-Policy + HSTS (issue #94) - #95

Merged
natechadwick merged 1 commit into
mainfrom
security/t2-4-security-headers
Aug 28, 2026
Merged

fix(security): T2.4 hardening: PSSecurityHeadersFilter for X-Frame-Options + X-Content-Type-Options + Referrer-Policy + HSTS (issue #94)#95
natechadwick merged 1 commit into
mainfrom
security/t2-4-security-headers

Conversation

@natechadwick-intsof

Copy link
Copy Markdown
Collaborator

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 / SecurityFilterChain 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 all webapps.

This PR adds a reusable filter and registers it in the 2 main Rhythmyx web.xml files. 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 simple Filter that 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, 0 is correct, not 1; mode=block)

All values are constants on the class. Future tuning is a one-line change.

2. Registration in 2 main web.xml files (2 files, +14 each)

  • projects/sitemanage/src/main/resources/Rhythmyx/sys_resources/webapps/secure/WEB-INF/web.xml
  • projects/sitemanage/src/main/resources/Rhythmyx/sys_resources/webapps/non-secure/WEB-INF/web.xml

Each gets a <filter> and <filter-mapping> block that registers the new filter at /* (after the existing PSCacheControlFilter / PSDefaultContentTypeFilter, before springSecurityFilterChain).

Verification

  • ./mvn-env.sh clean install -DskipTestsBUILD 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 under #73)

  • 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 (deps: EOL replace commons-httpclient 3.1 with org.apache.httpcomponents.client5:httpclient5 (closes 1 CVE) #88, deferred; multi-day migration)
  • T2.13 Eclipse Jetty 9.4.58 hardening (29+ CVEs)
  • T2.6 commons-collections4 input validation (2 CVEs)

References

Co-Authored by Mavis v1.0.0 using minimax-m3 with agent mavis.

…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
natechadwick merged commit ea17e8a into main Aug 28, 2026
3 checks passed
@natechadwick
natechadwick deleted the security/t2-4-security-headers branch August 28, 2026 23:03
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[security] T2.4 hardening: add PSSecurityHeadersFilter for X-Frame-Options, X-Content-Type-Options, Referrer-Policy (covers ~10+ of 45+ CVEs)

2 participants