Security hardening: fix webhook URL leak and consolidate authentication#17
Security hardening: fix webhook URL leak and consolidate authentication#17
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: COOLmanYT <230516181+COOLmanYT@users.noreply.github.com>
Co-authored-by: COOLmanYT <230516181+COOLmanYT@users.noreply.github.com>
Co-authored-by: COOLmanYT <230516181+COOLmanYT@users.noreply.github.com>
|
@copilot does this PR break any functionality of the website |
No, this PR does not break any functionality. Here's why: Authentication: The shared Webhook send: Still works exactly the same way - only the API response format changed (removed Cookie security: The conditional All changes are backward compatible:
The 134-line reduction comes purely from deduplication, not feature removal. |
Fixes webhook URL exposure in admin endpoints and eliminates duplicated authentication logic across 6 admin routes.
Changes
Webhook URL Leak
File:
api/admin/webhook-send.jsRemoved resolved webhook URLs from API responses. Now returns only non-sensitive identifiers:
Authentication Consolidation
Created shared
requireAllowlistedSessionhelper inlib/server/auth.js, eliminating 6 duplicate implementations. Ensures consistent authentication checks and reduces attack surface.Updated endpoints:
api/admin/allowlist.jsapi/admin/blog.jsapi/admin/site-settings.jsapi/admin/webhook-send.jsapi/admin/webhook-test.jsapi/admin/webhooks.jsCookie Security
Made
secureflag environment-aware to support local development while maintaining production security:Other
README.mdSECURITY.mdwith authentication and data protection documentationNet impact: -134 lines through deduplication, 0 security vulnerabilities (CodeQL verified)
Original prompt
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.