HomeMusing Studio

security: limit HTTP request body size to prevent memory-exhaustion DoS
dcc09bb63b8aUnpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

security: limit HTTP request body size to prevent memory-exhaustion DoS

Handlers read the request body (settings, posts, imports, collections) via
io.ReadAll on r.Body without an explicit size limit, allowing an unbounded
request body to exhaust server memory (denial of service).

Register a gorilla/mux body-limit middleware on the root router in InitRoutes
that wraps each request body with http.MaxBytesReader (default 32M), covering
all routes including subrouters.

Details

Provenance
AARUSHGAUR <aarush@example.com>Authored on Aug 30 2026, 3:12 AM
Parents
rWF049aa2a25af4: Merge pull request #1731 from writefreely/improve-missing-dir-errors
Branches
Unknown
Tags
Unknown

Event Timeline