-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or requestpriority-highHigh priorityHigh prioritysecuritySecurity related issuesSecurity related issues
Description
Description
The webhook endpoints in backend/app/api/webhooks.py don't verify request signatures, allowing anyone to send fake webhook requests.
Vulnerable Endpoints
POST /webhook/task-updatePOST /webhook/execution-update
Security Risk
Without signature verification:
- Attackers can inject fake task updates
- False execution status can be broadcasted to frontend
- Potential for denial of service attacks
- Data integrity compromised
Implementation Required
- Add HMAC signature verification using shared secret
- Validate
X-Kestra-Signatureheader - Reject requests with invalid signatures (return 403)
- Add signature verification middleware
- Document webhook setup in Kestra
Example Implementation
import hmac
import hashlib
def verify_webhook_signature(body: bytes, signature: str, secret: str) -> bool:
expected = hmac.new(secret.encode(), body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, signature)Location
- File:
backend/app/api/webhooks.py - Lines: 24-59
- Introduced in: PR Kestra end to end integration with the frontend and backend #37
Related
- Issue Protect API endpoints with authentication #16 (Authentication)
- Issue Add rate limiting and security headers #24 (Security headers)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestpriority-highHigh priorityHigh prioritysecuritySecurity related issuesSecurity related issues