← Java / Spring · 目录

JAVA-061 / 入门

分页大小无上限(Pageable 无限制)

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

为什么存在问题?

size=10000000 会耗尽内存及数据库资源。

如何修复

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

延伸阅读