ADVISORIES

PyPA Advisory Database

PYSEC-2026-3539

sanic-cors contains an improper regular expression in the try_match() function

Details

sanic-cors version 2.2.0 and prior contains an improper regular expression in the try_match() function in sanic_cors/core.py that uses re.match without end-anchoring. This allows an attacker to bypass CORS origin allowlists by registering a domain that begins with a trusted origin string, to gain unauthorized access to cross-origin requests for authenticated resources.

Affected packages

EcosystemPackageAffected versions
PyPIsanic-cors
All versions up to and including 2.2.0

References