spring-projects / spring-projects/spring-boot

Independent management max-in-memory-size property

Open
#34,926 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: enhancement
Dominant language
Java
Stars
81.5k
Forks
42.7k
Avg merge
2d 4h
Merged PRs (30d)
65

Description

Enhancement

Related: https://github.com/spring-projects/spring-boot/issues/9560
Implemented out of Spring Boot: https://github.com/ilozano2/sc-management-codec-max-size

Motivation

By default, the maximum size of any request payload a Spring boot application can read is 262144 bytes.

This value can be changed using the Spring property spring.codec.max-in-memory-size.
However, increasing the value of this property could expose the production controllers to some risks like DDOS attacks.

Spring Actuator endpoints or the port they listen are not usually exposed to the outside, so it could be safe to increase this value only for the Management Server in a controlled network.

Solution

As implemented in this project I've created, the developer can configure different max-in-memory-size for the management server (aka Spring Actuator endpoints).

management:
  codec:
    max-in-memory-size: 1MB

It is also possible to configure different sizes for management and server.

# Management Server Codec configurations
management:
  codec:
    max-in-memory-size: 1MB

# (original) Server Codec configurations
spring:
  codec:
    max-in-memory-size: 1KB

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the related Spring Boot issue #9560 and the linked sc-management-codec-max-size implementation. Compare the proposed management.codec.max-in-memory-size and spring.codec.max-in-memory-size settings, then verify that management and application server payload limits can be configured independently without weakening the default server limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.