valyala/fasthttp

It is not safe to read all stream body to memory without a max size limit.

Open

#1765 aperta il 23 apr 2024

Vedi su GitHub
 (8 commenti) (0 reazioni) (0 assegnatari)Go (1755 fork)batch import
help wanted

Metriche repository

Star
 (21.741 star)
Metriche merge PR
 (Merge medio 3g) (44 PR mergiate in 30 g)

Descrizione

https://github.com/valyala/fasthttp/blob/57b9352ad1cc93a0aaaa72b2130e03ace8a5b118/http.go#L427 I think it would be safe to stop reading the request body into memory and return an error when it exceeds the maximum request body size. Otherwise, it may lead to an out-of-memory (OOM) error when the request body is too large.

Guida contributor