KantoorWeb. Plugs. DavGuard
(Kantoor v1.0.0)
First line of defence for /dav and the /.well-known/{caldav,carddav}
entries, placed in the endpoint before the body parsers.
- Cookies are dropped: a signed-in browser session never authenticates DAV (that would be CSRF-able) and DAV never sets a cookie.
- Body size is capped (
config :kantoor, KantoorWeb.Plugs.DavGuard, max_body_bytes: ..., default 6 MiB): a largerContent-Lengthis413, and a body without a length (chunked) is411, so the DAV plug never reads an unbounded body. Plug.Parsersis told the body is already handled, so DAV bodies (including+jsonjCal) reach the DAV plug unread.