mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 21:18:11 -04:00
fix(webhooks): never lock out manual webhook deliveries with a valid signature
The failed-authentication lockout for manual webhooks was checked before the signature, and the bucket used the client IP from X-Forwarded-For. An unauthenticated client could send failed attempts with the Git host's address for a public repository and branch, and correctly signed deliveries then got 429, so deployments were lost. The lockout now applies only to deliveries that fail authentication; a delivery with a valid secret for a matched application is always processed. Failures are counted per connection address (REMOTE_ADDR, or CF-Connecting-IP on cloud), so rotating X-Forwarded-For no longer gives a new bucket.
This commit is contained in:
@@ -93,9 +93,6 @@ class Github extends Controller
|
||||
default => $base_branch,
|
||||
};
|
||||
$failure_key = $this->manualWebhookFailureRateLimitKey($request, 'github', $full_name, $matched_branch);
|
||||
if ($this->hasTooManyManualWebhookFailures($failure_key)) {
|
||||
return $this->tooManyManualWebhookFailuresResponse($failure_key);
|
||||
}
|
||||
// A redelivery of the same signed payload is one guess.
|
||||
$failure_attempt = $this->manualWebhookSignedPayloadAttempt($request, $x_hub_signature_256);
|
||||
$applications = Application::query();
|
||||
|
||||
Reference in New Issue
Block a user