From 05769240d3c9b4c88fa658ad543cc8c89001f419 Mon Sep 17 00:00:00 2001 From: Arc <33088785+arcbtc@users.noreply.github.com> Date: Tue, 10 Feb 2026 07:50:50 +0000 Subject: [PATCH] fix: fail closed on PayPal webhook verification errors (#3769) --- lnbits/core/services/fiat_providers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lnbits/core/services/fiat_providers.py b/lnbits/core/services/fiat_providers.py index 2733a49bb..9041010b4 100644 --- a/lnbits/core/services/fiat_providers.py +++ b/lnbits/core/services/fiat_providers.py @@ -118,8 +118,8 @@ async def verify_paypal_webhook(headers, payload: bytes): """ webhook_id = settings.paypal_webhook_id if not webhook_id: - logger.warning("PayPal webhook ID not set; skipping verification.") - return + logger.warning("PayPal webhook ID not set.") + raise ValueError("PayPal webhook cannot be verified. Missing webhook ID.") required_headers = { "PAYPAL-TRANSMISSION-ID": headers.get("PAYPAL-TRANSMISSION-ID"), @@ -129,8 +129,8 @@ async def verify_paypal_webhook(headers, payload: bytes): "PAYPAL-AUTH-ALGO": headers.get("PAYPAL-AUTH-ALGO"), } if not all(required_headers.values()): - logger.warning("Missing PayPal webhook headers; skipping verification.") - return + logger.warning("Missing PayPal webhook headers.") + raise ValueError("PayPal webhook cannot be verified. Missing headers.") try: async with httpx.AsyncClient(base_url=settings.paypal_api_endpoint) as client: