Summary
Coolify's GitHub webhook authentication can silently fall back to using an empty string as the HMAC key when the manual_webhook_secret_github is null.
Because this produces a deterministic, attacker-calculable signature, unauthenticated attackers can forge valid webhook requests and trigger deployments under these conditions.
Affected context
This vulnerability occurs in Coolify instances that rely on GitHub webhooks to trigger application deployments and leave the manual_webhook_secret_github configuration unset or null.
In this state, the HMAC verification logic still executes but uses an effectively public key (the empty string), making signature validation meaningless and allowing any party with network access to the webhook endpoint to submit requests that pass verification.
Exploit preconditions
- Attack surface: Public or internally exposed Coolify webhook endpoints receiving GitHub-style payloads.
- Required access: Network access to the webhook URL; no valid GitHub secret or credentials are needed when the secret is null.
- Trigger point: Submission of a crafted request containing a payload and an X-Hub-Signature-256 header computed as HMAC-SHA256 over the payload using an empty string key.
- Why exploitation is possible: PHP's hash_hmac() function coerces a null key to '', causing the server to accept signatures derived from a non-secret value that any attacker can replicate.
Why this happens
The underlying issue is an authentication design flaw where a nullable secret field is used directly as the HMAC key without enforcing non-null, non-empty constraints or providing a secure default.
In PHP, calling hash_hmac() with a null key results in implicit conversion to an empty string, which is not secret and therefore unsuitable for authentication.
This maps to CWE-287: Improper Authentication, as the system appears to perform HMAC verification but does so with a predictable key, effectively disabling the authenticity guarantees of the webhook signature mechanism.
Potential impact
- Unauthenticated attackers could trigger arbitrary deployments for affected applications.
- Attackers may force deployment of unreviewed or malicious code if CI/CD pipelines are weakly controlled.
- Automated deployment workflows can be abused to cause service disruption or resource exhaustion.
- Logs and auditing systems may misleadingly record these actions as legitimate webhook-triggered events.
General mitigation guidance
Mitigation generally focuses on hardening authentication around webhook handling and treating secrets as mandatory security-critical configuration.
Recommended patterns include:
- Enforcing non-null, non-empty constraints for any secret used in HMAC or similar authentication schemes.
- Implementing configuration validation that prevents enabling webhook endpoints unless a strong secret is set.
- Using separate, randomly generated secrets for each application or integration, stored in a secure configuration store.
- Designing authentication logic to fail closed: if a secret is missing or invalid, reject all webhook requests by default.
- Applying defense-in-depth by limiting which actions unauthenticated webhook requests can trigger and using least privilege for deployment agents.
How teams detect issues like this
Effective detection combines configuration analysis with code-level review:
- Static analysis or code review to identify uses of hash_hmac() (or similar APIs) where keys can be null, empty, or otherwise non-secret.
- Configuration audits to flag applications or environments where webhook secrets are unset, null, or default-valued.
- Runtime monitoring and alerting on webhook endpoints for unusually frequent or anomalous deployment triggers from unexpected IP ranges or sources.
- Policy enforcement in CI/CD pipelines that require validated secrets and authentication checks before allowing deployment actions to proceed.

