The webhook receiver endpoint at /webhook/{uuid} accepts any HTTP method (GET, PUT, DELETE, HEAD, etc.) because routes.go uses HandleFunc instead of a method-specific handler:
Note: The README documents this as ANY /webhook/{uuid} which suggests it might be intentional. If so, the handler should still validate that the request has meaningful content for non-POST methods.
Category
Should-fix for 1.0.
## Bug
The webhook receiver endpoint at `/webhook/{uuid}` accepts any HTTP method (GET, PUT, DELETE, HEAD, etc.) because `routes.go` uses `HandleFunc` instead of a method-specific handler:
```go
s.router.HandleFunc("/webhook/{uuid}", s.h.HandleWebhook())
```
A GET request to a webhook endpoint creates an empty event with no body and queues deliveries to all targets. This could:
- Pollute the event log with empty events from web crawlers, health checks, or accidental browser visits
- Trigger unnecessary deliveries to HTTP targets
- Skew metrics
## Fix
Use `router.Post()` to restrict to POST only, or add method filtering in the handler:
```go
s.router.Post("/webhook/{uuid}", s.h.HandleWebhook())
```
Note: The README documents this as `ANY /webhook/{uuid}` which suggests it might be intentional. If so, the handler should still validate that the request has meaningful content for non-POST methods.
## Category
Should-fix for 1.0.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Bug
The webhook receiver endpoint at
/webhook/{uuid}accepts any HTTP method (GET, PUT, DELETE, HEAD, etc.) becauseroutes.gousesHandleFuncinstead of a method-specific handler:A GET request to a webhook endpoint creates an empty event with no body and queues deliveries to all targets. This could:
Fix
Use
router.Post()to restrict to POST only, or add method filtering in the handler:Note: The README documents this as
ANY /webhook/{uuid}which suggests it might be intentional. If so, the handler should still validate that the request has meaningful content for non-POST methods.Category
Should-fix for 1.0.