You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Particular requests fail with HTTP/413 due to darkhttpd's 4k request limit #602
CozyStack uses darkhttpd in 'cozystack' deployment itself. The problem is that https requests with OIDC authentication cookies can fail with a 413 error if the total HTTP request length exceeds 4 KB. This happens because darkhttpd has a hardcoded #define MAX_REQUEST_LENGTH 4000 (ref. darkhttpd.c#L312):
#defineMAX_REQUEST_LENGTH 4000
...
if (conn->request_length>MAX_REQUEST_LENGTH) {
default_reply(conn, 413, "Request Entity Too Large",
"Your request was dropped because it was too long.");
conn->state=SEND_HEADER;
}
When OIDC against keycloak is enabled configurations, the browser sends quite large cookies (e.g., _oauth2_proxy_0 and _oauth2_proxy_1), pushing the total request size above 4 KB. Darkhttpd rejects these requests with the 413:
Build customized darkhttpd with less strict limitation on the request size (though I'm not sure it's a good idea due to probably there might be some implications related to the c language and memory management etc.).
Deploy some kind of an intermediate reverse proxy that will handle the authentication/authorization and strip cookies.
Suggest to make MAX_REQUEST_LENGTH configurable via cmdline.
Activity
kvaps commentedon Jan 23, 2025
Thank you for report, this should be fixed by #596 in the next release
Replace darkhttpd with cozystack-assets-server (cozystack#596)