Support configurable HTTP security headers across API, page and admin responses

Abierto
#38,639 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
java

Línea de trabajo

Start by reading the existing Tomcat HttpHeaderSecurityFilter configuration in WEB-INF/web.xml and the VelocityLiveMode code that applies ContentSecurityPolicy.header. Trace how API, page, and admin responses are created and how DOT_ properties and forwarded protocol information are handled. Done means the acceptance criteria are covered, including configurable headers across the response types, safe defaults, and documented recommendations.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

OKR : Customer Support Team : Maintenance Type : New Functionality
Problem Statement

dotCMS has no supported, configurable way to send a standard set of HTTP security headers on all responses. Security scans flag missing Strict-Transport-Security, Content-Security-Policy, Referrer-Policy and Permissions-Policy headers on API, page and admin responses.

Current behavior:

  • HSTS comes only from Tomcat's HttpHeaderSecurityFilter in WEB-INF/web.xml (hstsMaxAgeSeconds=3600). Tomcat only sends it on secure requests, so it is missing when TLS ends at a reverse proxy or load balancer, which is the usual deployment. The value can't be configured with an environment variable.
  • Content-Security-Policy (ContentSecurityPolicy.header) is applied only to Velocity-rendered pages (VelocityLiveMode), not to REST/GraphQL responses or the admin UI.
  • Referrer-Policy and Permissions-Policy are never set.
Steps to Reproduce
  1. Run dotCMS behind a reverse proxy that terminates TLS (default Docker/Kubernetes setup).
  2. Request POST /api/v1/graphql, a rendered page and an admin URL over HTTPS.
  3. Inspect the response headers.
  4. Observe Strict-Transport-Security, Content-Security-Policy, Referrer-Policy and Permissions-Policy are absent (CSP only appears on pages, and only when ContentSecurityPolicy.header is set).
Acceptance Criteria
  • HSTS can be enabled and configured with DOT_ properties, and is sent when the original request was HTTPS behind a proxy (e.g. honoring X-Forwarded-Proto).
  • Referrer-Policy and Permissions-Policy can be set with config properties.
  • CSP can be set separately for API responses and admin UI responses, not only Velocity pages.
  • Defaults don't break the admin UI, UVE/headless editing, or existing integrations.
  • A recommended baseline header set for self-hosted installs is documented.
dotCMS Version

26.09.28-02 (also present on main)

Severity

Medium - Some functionality impacted

Links
Lenguaje dominante
Java
Estrellas
972
Forks
493
Merge medio
2 d 12 h
PR fusionados (30 d)
228

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de dotCMS/core

Todos los issues de dotCMS/core

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.