Skip to content

Web console security headers are not sent (RewriteHandler in jetty-webapps.xml never wraps the webapps) #2659

Open

Description

@PaulGale

Affects: 6.3.0, 6.3.1, 6.3.2, and main (webconsole). It was introduced in 6.3.0; 6.2.x does not use jetty-webapps.xml.

Problem
Since the Jetty 12 / EE11 migration (AMQ-9359), the web console no longer sends the security headers added by AMQ-7265, AMQ-9545 and AMQ-9697, such as X-Frame-Options, Content-Security-Policy and X-Content-Type-Options. The rules are still defined, but they never run.

Steps to reproduce (stock binary distribution, default config)

Unpack apache-activemq-6.3.1-bin.tar.gz and run bin/activemq start.
curl -s -o /dev/null -D - -u <admin user>:<password> http://127.0.0.1:8161/admin/

Expected: 200 with the headers defined in conf/jetty/jetty-webapps.xml.
Actual: 200 with none of them.

Cause
conf/jetty/jetty-webapps.xml adds the header RewriteHandler to the Contexts ContextHandlerCollection as a sibling of the /admin and /api WebAppContexts, with no child handler. ContextHandlerCollection only routes requests to handlers that contain a ContextHandler, so the RewriteHandler is never on the request path for the webapps. When it is reached, it fails with IllegalStateException: RewriteHandler: Child handler is not set. (HTTP 500).

Suggested fix
Insert the RewriteHandler into the Server's handler chain so that it wraps Contexts, for example with Server.insertHandler(...), instead of adding it to Contexts. Then add a test that asserts one of the headers on an authenticated /admin/ response.

Activity

  1. Utkarsh-rwt commented on Oct 16, 2026

    @Utkarsh-rwt

    Hi @PaulGale I would like to work on it. I'll submit a PR once I've verified the changes.

  2. changed the title [-][6.3.x] Web console security headers are not sent (RewriteHandler in jetty-webapps.xml never wraps the webapps)[/-] [+]Web console security headers are not sent (RewriteHandler in jetty-webapps.xml never wraps the webapps)[/+] on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions