☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
[ VENDOR STATS ]
CVSS: 4.3 🐛 CWE-41
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2024-6839

CVE-2024-6839 Supply Chain Attack in Corydolphin
📅 PUBLISHED: 2025-03-20 10:09 UTC 🔄 UPDATED: 2026-09-24 06:00 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: LIKELY — 2 independent sources confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.73%
👁️
0.73% probability
18.1× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
Patch available — upgrade to latest release
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
4.3
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-6839 is an improper regex path matching vulnerability in the corydolphin/flask-cors Python library, version 4.0.1. The flaw arises from the plugin’s regex prioritization logic, which incorrectly favors longer regex patterns over more specific ones when matching URL paths. This can lead to less restrictive CORS policies being applied to sensitive endpoints, potentially allowing unauthorized cross-origin access to confidential data or functionality. The CVSS score is 4.3 (Medium), with an EPSS probability of 0.0% indicating low exploitation likelihood at this time. No public exploit code or patch is currently available.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

This vulnerability affects the flask-cors PyPI package. As a widely used extension for Flask applications, any application using version 4.0.1 is at risk. The lack of a patch means that supply chain security is compromised for all downstream consumers. Organizations should audit their dependencies for this version and consider temporary mitigations until an official fix is released.

CVSS Breakdown & Threat Level

  • CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
  • Base Score: 4.3 (Medium)
  • Attack Vector: Network
  • Attack Complexity: Low
  • Privileges Required: None
  • User Interaction: None
  • Scope: Unchanged
  • Confidentiality Impact: Low
  • Integrity Impact: None
  • Availability Impact: None

The threat level is Medium due to the potential for unauthorized data exposure, though exploitation requires specific conditions (e.g., a misconfigured CORS policy that exposes sensitive endpoints).

Deep Dive & Mechanics

The vulnerability lies in the flask-cors library’s path matching algorithm. When multiple regex patterns are defined for CORS rules, the library incorrectly prioritizes longer patterns over more specific ones. For example, a pattern like /api/.* (longer) might be matched before a more specific pattern like /api/admin (shorter but more restrictive). This can result in a less restrictive CORS policy (e.g., allowing all origins) being applied to sensitive endpoints like /api/admin, bypassing intended access controls.

The core issue is in the match_path function, which uses a simple length-based priority instead of a specificity-based priority. This is a classic regex precedence bug.

Vulnerable vs. Patched Code

Vulnerable Code (flask-cors 4.0.1):

# In cors.py or similar
def match_path(path, patterns):
    # Incorrectly prioritizes longer patterns
    matched = None
    for pattern in patterns:
        if re.match(pattern, path):
            if matched is None or len(pattern) > len(matched):
                matched = pattern
    return matched

Patched Code (Hypothetical Fix):

# Correctly prioritizes more specific patterns
def match_path(path, patterns):
    matched = None
    for pattern in patterns:
        if re.match(pattern, path):
            if matched is None or pattern_specificity(pattern) > pattern_specificity(matched):
                matched = pattern
    return matched

def pattern_specificity(pattern):
    # Count non-wildcard characters as a measure of specificity
    return len(pattern) - pattern.count('.*') - pattern.count('*')

Exploitation & Lab Setup

Red Team

Prerequisites:

  • A Flask application using flask-cors version 4.0.1 with multiple CORS patterns.
  • A sensitive endpoint (e.g., /api/admin) that should have a restrictive CORS policy.

Exploitation Steps:

  1. Identify the target application’s CORS configuration (e.g., via OPTIONS requests).
  2. Craft a cross-origin request from a malicious origin to the sensitive endpoint.
  3. Observe that the less restrictive CORS policy is applied due to the regex prioritization bug.

Example Exploit (JavaScript):

// Malicious origin: https://attacker.com
fetch('https://victim.com/api/admin', {
  method: 'GET',
  credentials: 'include'
}).then(response => {
  // If CORS allows, data is exfiltrated
  console.log(response.json());
});

Blue Team

Detection:

  • Monitor for unexpected Origin headers in requests to sensitive endpoints.
  • Log and alert on CORS policy mismatches.

Mitigation:

  • Temporarily disable CORS for sensitive endpoints or use a custom middleware.
  • Upgrade to a patched version once available.
  • Implement additional authentication/authorization checks.

Indicators of Compromise (IOCs)

  • Network: HTTP requests with Origin headers from unexpected domains to sensitive endpoints.
  • Application Logs: CORS policy mismatches logged by the application.
  • Dependency: Presence of flask-cors==4.0.1 in requirements.txt or Pipfile.

Detection Engineering

YARA Rule

rule flask_cors_vuln_4_0_1 {
    meta:
        description = "Detects flask-cors version 4.0.1 with regex prioritization bug"
        author = "Valters IT"
        date = "2025-04-10"
        hash = "sha256:examplehash"
    strings:
        $version = "4.0.1"
        $cors_import = "from flask_cors import CORS"
        $match_path = "def match_path"
    condition:
        $version and $cors_import and $match_path
}

Sigma Rule

title: CVE-2024-6839 - Flask-CORS Regex Prioritization Vulnerability
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects potential exploitation of CVE-2024-6839 via anomalous CORS headers
logsource:
    category: webserver
    product: flask
detection:
    selection:
        http.response.header|contains: 'Access-Control-Allow-Origin'
        http.request.header|contains: 'Origin'
    condition: selection
falsepositives:
    - Legitimate cross-origin requests
level: medium

Suricata Rule

alert http any any -> any any (msg:"CVE-2024-6839 - Flask-CORS Regex Prioritization Exploit"; flow:to_server; content:"Origin"; http_header; content:"Access-Control-Allow-Origin"; http_header; sid:1000001; rev:1;)

Remediation & Mitigation

  1. Immediate: Remove or restrict CORS for sensitive endpoints using a custom middleware.
  2. Short-term: Monitor for updates from the flask-cors maintainer and apply patches as soon as available.
  3. Long-term: Implement a Web Application Firewall (WAF) rule to block unexpected origins.
  4. Code Review: Audit all CORS configurations for regex specificity issues.

Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-6839/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.