Seguridad /qr: HTTP Basic Auth con QR_TOKEN dedicado (no secreto en la URL)
Review de seguridad: autenticar por query string filtra el secreto (logs, historial, Referer) y usaba la misma FUNNEL_API_KEY que autoriza la API. Ahora /qr usa HTTP Basic (credencial en cabecera), un QR_TOKEN dedicado distinto de FUNNEL_API_KEY, comparación en tiempo constante (timingSafeEqual sobre hashes) y Referrer-Policy: no-referrer. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -136,7 +136,7 @@ export class WhatsappService implements OnModuleInit, OnModuleDestroy {
|
||||
|
||||
if (qr) {
|
||||
QRCode.generate(qr, { small: true });
|
||||
console.log('\n📲 Escanea este QR con WhatsApp (o abre /qr?key=FUNNEL_API_KEY)\n');
|
||||
console.log('\n📲 Escanea este QR con WhatsApp (o abre la página /qr, protegida con QR_TOKEN)\n');
|
||||
this.webhookListener.setQr(qr);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user