← Java / Spring · Contents

JAVA-061 / Beginner

No maximum page size (unbounded Pageable)

A04:2021 Insecure Design · CWE-770 Allocation of Resources Without Limits

Why is this a problem?

size=10000000 exhausts memory and DB resources.

How to fix it

yaml
spring.data.web.pageable.max-page-size: 100

Further reading