Skip to content

[JENKINS-39402] Jenkins creates massive HTTP headers that blows up proxies #17651

Description

@jenkins-infra-bot

When Jenkins serves an access denied for a page it includes in the HTTP headers ever group that the current user is a member of.

In a large corporate environment this can be hundreds of groups which causes many KBs of headers.
nginx, HAProxy, Apache HTTPd and other proxies limit the maximum size and number of HTTP headers - so in this case instead of the access denied the user would see a 502 error from the proxy which hides the underlying issue. (FWIW HAProxy limits the number of headers to 101 - and classes an application that uses more than this amount of headers as buggy)

There is no reason to send all the list of groups by default - it perhaps could be enabled by a property but default to disabled, but in reality exposing what permission you need to the end user and what permissions they have is rarely (if ever) used.

This is the code in question that needs fixing.


Originally reported by teilo, imported from: Jenkins creates massive HTTP headers that blows up proxies
  • assignee: jglick
  • status: Resolved
  • priority: Critical
  • component(s): core
  • label(s): 2.32.3-fixed, http, robustness
  • resolution: Fixed
  • resolved: 2017-02-10T16:10:28+00:00
  • votes: 0
  • watchers: 5
  • imported: 2025-11-24
Raw content of original issue

When Jenkins serves an access denied for a page it includes in the HTTP headers ever group that the current user is a member of.

In a large corporate environment this can be hundreds of groups which causes many KBs of headers. nginx, HAProxy, Apache HTTPd and other proxies limit the maximum size and number of HTTP headers - so in this case instead of the access denied the user would see a 502 error from the proxy which hides the underlying issue. (FWIW HAProxy limits the number of headers to 101 - and classes an application that uses more than this amount of headers as buggy)

There is no reason to send all the list of groups by default - it perhaps could be enabled by a property but default to disabled, but in reality exposing what permission you need to the end user and what permissions they have is rarely (if ever) used.

This is the code in question that needs fixing.

Metadata

Metadata

Assignees

No one assigned

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions