Skip to main content

sanic-cors CVE-2026-37737

| EUVDEUVD-2026-34844 MEDIUM
Origin Validation Error (CWE-346)
2026-06-05 mitre GHSA-94jw-hqvj-vw74
6.5
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Register domain prefixed with trusted CORS origin
  2. Delivery
    Host malicious JavaScript page on attacker domain
  3. Exploit
    Lure authenticated victim user to malicious page
  4. Install
    Browser issues cross-origin fetch to target Sanic application
  5. C2
    sanic-cors try_match() prefix-matches attacker origin as trusted
  6. Execute
    Target API returns authenticated response to attacker script
  7. Impact
    Attacker exfiltrates sensitive data

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A07:2025 - Authentication Failures
ASVS 5.0
V6 - Authentication Origin validation
Exploitation Conditions

The target application must use sanic-cors 2.2.0 or earlier as its CORS middleware. The CORS configuration must include at least one origin in the allowlist - whether a string or regex pattern - that the attacker can prefix-match by registering a domain starting with that trusted origin string (e.g., trusted.com becomes a prefix for trusted.com.evil.org). The CVSS vector confirms UI:R, meaning a victim user must be socially engineered into visiting the attacker-controlled domain; passive or server-side exploitation is not possible. PR:N confirms the attacker requires no authentication to the target application. The scope of harm is limited to applications where CORS enforcement is a meaningful security boundary - applications that already require Authorization headers or CSRF tokens for sensitive endpoints are less impacted since CORS bypass alone does not satisfy those controls. Non-default condition: impact is negligible if the application's CORS policy uses only exact-match string origins (not regex patterns), since sanic-cors regex matching is only invoked for pattern-type entries.

Impact

The CVSS 3.1 base score of 6.5 (AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N) reflects a realistic threat model: network-reachable, low attack complexity, no authentication or privileges required, but user interaction is mandatory - the victim must navigate to an attacker-controlled web page that triggers the cross-origin request. The high Confidentiality impact (C:H) correctly captures that CORS bypass enables reading authenticated API responses, session tokens, or sensitive data from target applications. Integrity and Availability are unaffected (I:N/A:N), scoping the harm to data disclosure. No EPSS score was provided, so exploitation probability cannot be quantified from probabilistic modeling. The vulnerability is not listed in CISA KEV, and no confirmed public exploit code was identified - a security advisory exists on GitHub (authored by npbhatter17) which may indicate coordinated disclosure research rather than weaponized exploitation. Overall, this is a meaningful but not critical-severity issue: real-world impact depends entirely on whether the target Sanic application enforces CORS as a security boundary for sensitive authenticated resources, rather than merely for browser ergonomics.

Exploit ScenarioDerived

An attacker registers a domain such as api.trusted-corp.com.attacker.io, where api.trusted-corp.com is a string on the target server's CORS allowlist. The attacker hosts a malicious JavaScript page on this domain that issues fetch() requests to the victim application's authenticated API endpoints. When a logged-in user visits the attacker's page, the browser sends the cross-origin request with the attacker's origin header, the sanic-cors middleware incorrectly validates it as allowed due to the prefix match, and the API response - including sensitive user data - is returned to the attacker's script. A security advisory (https://github.com/npbhatter17/security-advisories/blob/main/CVE-2026-37737-sanic-cors-advisory.md) exists, suggesting the technique has been documented by researchers.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
No patch listed yet 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 05, 2026

CORS origin allowlist bypass in sanic-cors 2.2.0 and prior enables cross-origin access to authenticated resources by exploiting an unanchored regular expression in the origin-matching logic. The library's try_match() function in sanic_cors/core.py uses Python's re.match() - which matches only from the start of a string, not the full string - allowing an attacker who controls a domain prefixed with a trusted origin (e.g., trusted.example.com.attacker.com) to satisfy the allowlist check. Exploitation requires a victim user to visit an attacker-controlled page, placing this in a network-accessible, user-interaction-required threat model. No public exploit code has been identified at time of analysis, and no KEV listing exists.

RemediationAI

No vendor-released patch has been identified at time of analysis. Defenders should monitor the upstream repository at https://github.com/ashleysommer/sanic-cors and the PyPI package at https://pypi.org/project/Sanic-Cors/ for a fix release. As a compensating control, application owners can manually patch the try_match() function in their local installation by replacing re.match(pattern, origin) with re.fullmatch(pattern, origin), or by appending a '$' end anchor to all origin patterns before compilation - this ensures the full origin string is matched. Trade-off: this manual patch will be overwritten on package upgrade and requires re-application. Additionally, if the application allows wildcard or prefix-style origin patterns in its CORS configuration, tighten these to exact-string literals where possible, reducing reliance on regex matching altogether. Review whether CORS is functioning as an actual security boundary in the application; if sensitive authenticated endpoints rely solely on CORS enforcement without additional access controls (e.g., CSRF tokens, Authorization headers), add those controls as defense-in-depth.

Affected VersionsENISA

n/a n/a

Affected Packages

pypi sanic-cors no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

sanic-cors is the CORS middleware library for the Sanic async Python web framework, analogous to flask-cors or django-cors-headers. CORS enforcement depends on accurately matching the incoming Origin header against a server-configured allowlist. The root cause is CWE-346 (Origin Validation Error): the try_match() function at sanic_cors/core.py uses Python's re.match(), which anchors only at the beginning of a string. When an allowlist entry such as 'https://trusted.example.com' is compiled as a pattern and matched via re.match(), the string 'https://trusted.example.com.attacker.com' satisfies the match because re.match() returns a match object for any input that starts with the pattern. The correct fix is re.fullmatch() or appending a '$' end anchor. Affected versions are 2.2.0 and all prior releases; CPE data in NVD is currently listed as n/a, meaning no machine-readable product identifier has been assigned yet.

Know when N A gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

NVD PRIMARY 6.5 MEDIUM
AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N

Primary rating from NVD · only source for this CVE.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

Lifecycle Timeline

2
CVSS changed
Jun 05, 2026 - 21:22 NVD
6.5 (MEDIUM)
CVE Published
Jun 05, 2026 - 00:00 nvd
UNKNOWN (no severity yet)

DescriptionCVE.org

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.

Threat Intelligence Overview

EPSS Score
0.0%
Top 97% exploitable
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available No
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

32
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +32
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

More in N A

View all
CVE-2024-51092 CRITICAL POC
9.1 May 08

LibreNMS before 24.10.0 allows a remote attacker to execute arbitrary code via OS command injection involving AboutContr

CVE-2025-15684 MEDIUM POC
5.5 Aug 12

Reachable assertion in Open5GS up to version 2.7.6 allows remote unauthenticated attackers to crash the Diameter CER han

CVE-2024-45257 HIGH POC
7.3 May 08

A Command Injection issue in the payload build page in BYOB (Build Your Own Botnet) 2.0 allows attackers to execute arbi

CVE-2025-15687 LOW POC
2.1 Aug 12

Denial of service in Open5GS 2.7.6 and earlier allows network-adjacent attackers with low-privilege Diameter Gx peer acc

CVE-2025-15686 LOW POC
2.1 Aug 12

Denial of service in Open5GS HSS (Home Subscriber Server) versions 2.7.0 through 2.7.6 is triggered remotely by manipula

CVE-2025-67888 HIGH POC
7.3 May 08

Remote command injection in Control Web Panel allows unauthenticated attackers to execute arbitrary OS commands as root

CVE-2024-53326 HIGH POC
7.3 May 08

LINQPad before 5.52.01 Pro edition is vulnerable to Unsafe Deserialization in LINQPad.AutoRefManager::PopulateFromCache(

CVE-2026-38360 CRITICAL POC
9.8 May 08

Remote code execution in dash-uploader (Python package for Plotly Dash) versions 0.1.0 through 0.7.0a2 allows unauthenti

CVE-2026-30623 CRITICAL POC
9.8 Jul 15

Command injection in LiteLLM 1.18.10 lets attackers who can configure MCP (Model Context Protocol) servers supply arbitr

CVE-2026-67917 CRITICAL POC
9.8 Aug 17

SQL injection in AzuraCast's backup restore flow (versions up to and including 0.23.7) lets an attacker achieve privileg

CVE-2026-75337 CRITICAL POC
9.8 Aug 27

Arbitrary file read in Yu AI Code Mother v4.3 lets anonymous, remote attackers retrieve files outside the intended previ

CVE-2026-31072 CRITICAL POC
9.8 May 19

Remote code execution in APScheduler (all versions through 3.10.x and 4.0.0a5) is achievable when applications deseriali

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy