The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2023-30861

CVE-2023-30861: Flask Information Disclosure Vulnerability

CVE-2023-30861 is an information disclosure vulnerability in Palletsprojects Flask that may expose session cookies between clients via caching proxies. This article covers technical details, affected versions, and fixes.

Published: February 4, 2026

CVE-2023-30861 Overview

Flask is a lightweight WSGI web application framework widely used for building Python web applications. A session cookie caching vulnerability exists in Flask that can cause responses containing data intended for one client to be cached and subsequently sent by a proxy to other clients. If the proxy also caches Set-Cookie headers, it may send one client's session cookie to other clients, leading to potential session hijacking and unauthorized access.

Critical Impact

Under specific conditions, session cookies can be leaked to unauthorized clients through caching proxies, potentially allowing attackers to impersonate other users and access sensitive data.

Affected Products

  • Palletsprojects Flask versions prior to 2.2.5
  • Palletsprojects Flask versions 2.3.x prior to 2.3.2
  • Applications hosted behind caching proxies that do not strip cookies

Discovery Timeline

  • 2023-05-02 - CVE CVE-2023-30861 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2023-30861

Vulnerability Analysis

This vulnerability occurs when a Flask application is deployed behind a caching proxy and specific session configurations are enabled. The issue stems from Flask's handling of the Vary: Cookie HTTP header, which is critical for instructing caching proxies to store separate cached copies of responses for different cookie values.

Vulnerable versions of Flask only set the Vary: Cookie header when the session is explicitly accessed or modified during a request. However, when SESSION_REFRESH_EACH_REQUEST is enabled (which is the default setting), Flask will refresh the session cookie to update its expiration time even if the application code never accesses or modifies the session. In this refresh scenario, the Vary: Cookie header is not set, causing caching proxies to potentially serve the same cached response (including the refreshed session cookie) to multiple different clients.

The vulnerability requires all of the following conditions to be met:

  1. The application must be hosted behind a caching proxy that does not strip cookies or ignore responses with cookies
  2. The application sets session.permanent = True
  3. The application does not access or modify the session at any point during a request
  4. SESSION_REFRESH_EACH_REQUEST is enabled (the default)
  5. The application does not set a Cache-Control header to indicate that a page is private or should not be cached

Root Cause

The root cause is a missing Vary: Cookie header in HTTP responses when Flask refreshes the session cookie without the session being explicitly accessed or modified. This omission causes caching proxies to incorrectly cache responses with session cookies and serve them to other clients.

Attack Vector

The attack is network-based and requires no authentication or user interaction. An attacker can exploit this vulnerability by waiting for a victim to make a request through a vulnerable caching proxy. When the victim's response (containing their session cookie) is cached without the proper Vary: Cookie header, subsequent requests from the attacker may receive the cached response with the victim's session cookie.

The fix adds the Vary: Cookie header whenever the session is accessed, ensuring caching proxies properly differentiate cached responses based on cookies:

python
         samesite = self.get_cookie_samesite(app)
         httponly = self.get_cookie_httponly(app)
 
+        # Add a "Vary: Cookie" header if the session was accessed at all.
+        if session.accessed:
+            response.vary.add("Cookie")
+
         # If the session is modified to be empty, remove the cookie.
         # If the session is empty, return without setting the cookie.
         if not session:

Source: GitHub Flask Commit

Detection Methods for CVE-2023-30861

Indicators of Compromise

  • HTTP responses from Flask applications missing the Vary: Cookie header when session cookies are present
  • Multiple users receiving identical session cookies in cached responses
  • Anomalous session activity showing users accessing accounts they do not own
  • Caching proxy logs showing responses with Set-Cookie headers being served to multiple distinct clients

Detection Strategies

  • Monitor HTTP response headers for Flask applications to verify Vary: Cookie is present when session cookies are set
  • Implement logging at the proxy layer to detect when responses containing Set-Cookie headers are being cached and served to multiple clients
  • Review application code for patterns where session.permanent = True is set but the session is not accessed during request processing
  • Audit Flask version deployed across your infrastructure to identify vulnerable instances

Monitoring Recommendations

  • Set up alerts for authentication anomalies where users appear to be logged in as other users
  • Monitor proxy cache hit rates for pages that should be user-specific
  • Implement session validation checks that verify session cookies match the expected client IP or user agent
  • Review access logs for patterns indicating session cookie reuse across different IP addresses

How to Mitigate CVE-2023-30861

Immediate Actions Required

  • Upgrade Flask to version 2.3.2 or 2.2.5 or later immediately
  • Configure your caching proxy to not cache responses containing Set-Cookie headers
  • Add explicit Cache-Control: private or Cache-Control: no-store headers to responses that involve session handling
  • If upgrading is not immediately possible, set SESSION_REFRESH_EACH_REQUEST = False in your Flask configuration

Patch Information

Palletsprojects has released security patches addressing this vulnerability. The fix ensures that the Vary: Cookie header is set whenever the session is accessed, modified, or refreshed. Upgrade to one of the following versions:

  • Flask 2.3.2 - for applications on the 2.3.x branch
  • Flask 2.2.5 - for applications on the 2.2.x branch

Additional security advisories have been issued by Debian and NetApp. For detailed information, see the GitHub Security Advisory.

Workarounds

  • Set SESSION_REFRESH_EACH_REQUEST = False in Flask configuration to prevent automatic session refresh without access
  • Configure your reverse proxy or CDN to never cache responses containing Set-Cookie headers
  • Add Cache-Control: private header to all responses that may involve session handling
  • Implement application-level caching controls that explicitly set proper cache headers for all routes
bash
# Flask configuration workaround (app.py)
# Add to your Flask app configuration to disable automatic session refresh:
# app.config['SESSION_REFRESH_EACH_REQUEST'] = False

# Nginx proxy configuration to avoid caching responses with Set-Cookie:
# proxy_no_cache $http_set_cookie;
# proxy_cache_bypass $http_set_cookie;

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeInformation Disclosure

  • Vendor/TechFlask

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.18%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-539
  • Technical References
  • GitHub Flask Release 2.2.5

  • GitHub Flask Release 2.3.2

  • Debian LTS Announcement

  • NetApp Security Advisory NTAP-20230818-0006

  • Debian Security Advisory DSA-5442
  • Vendor Resources
  • GitHub Flask Commit Update

  • GitHub Flask Commit Update

  • GitHub Security Advisory GHSA-m2qf-hxjv-5gpq
  • Related CVEs
  • CVE-2026-27205: Flask Information Disclosure Vulnerability

  • CVE-2025-47278: Flask Authentication Bypass Vulnerability
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English