mirror of
https://github.com/penpot/penpot.git
synced 2026-09-15 16:38:41 +00:00
The management API shared-key-auth middleware was using the standard = operator for key comparison, which is vulnerable to timing attacks. The RPC middleware already uses constant-time comparison via MessageDigest/isEqual. This change: - Makes constant-time-eq? public in app.http.middleware - Updates app.http.management/shared-key-auth to use mw/constant-time-eq? - Fixes an inconsistency where the nil-key branch returned a 2-arg function - Adds comprehensive tests for the management shared-key-auth middleware Closes #11426 AI-assisted-by: qwen3.7-plus