Summary
The GitHub webhook endpoint returns HTTP 500 Internal Server Error when the X-Hub-Signature-256 header is missing, instead of the expected HTTP 401 Unauthorized.
Steps to reproduce
Send a POST to your Dokploy webhook endpoint with a well-formed GitHub-like JSON payload but without the X-Hub-Signature-256 header:
curl -sS -X POST "https://<your-dokploy>/api/deploy/github" \
-H "Content-Type: application/json" \
-H "X-GitHub-Event: push" \
-H "X-GitHub-Delivery: test-$(uuidgen)" \
-d '{"action":"test","installation":{"id":<valid-installation-id>},"repository":{"full_name":"foo/bar"}}'
Expected
HTTP 401 Unauthorized with a structured error body (e.g. {"message":"Missing signature header"}), consistent with the response for an invalid signature.
Actual
HTTP 500 Internal Server Error with body Internal Server Error.
Context
- Dokploy
v0.29.1
- Consistent behavior: sending a wrong signature header returns
401 correctly — only a missing header crashes into 500.
- Likely cause: the HMAC comparison path raises when
X-Hub-Signature-256 is undefined before the nullity check.
Why it matters
- Not a security hole (the signature check still prevents unauthorized deploys), but 500 makes monitoring noisy, can pollute error-tracking (Sentry etc.), and implies server-side crash instead of expected auth rejection.
- Fix should be trivial: normalize missing-header and bad-signature into the same 401 branch.
Summary
The GitHub webhook endpoint returns
HTTP 500 Internal Server Errorwhen theX-Hub-Signature-256header is missing, instead of the expectedHTTP 401 Unauthorized.Steps to reproduce
Send a POST to your Dokploy webhook endpoint with a well-formed GitHub-like JSON payload but without the
X-Hub-Signature-256header:Expected
HTTP 401 Unauthorizedwith a structured error body (e.g.{"message":"Missing signature header"}), consistent with the response for an invalid signature.Actual
HTTP 500 Internal Server Errorwith bodyInternal Server Error.Context
v0.29.1401correctly — only a missing header crashes into 500.X-Hub-Signature-256isundefinedbefore the nullity check.Why it matters