Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
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
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • 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-2021-36740

CVE-2021-36740: Varnish Cache Auth Bypass Vulnerability

CVE-2021-36740 is an authentication bypass flaw in Varnish Cache with HTTP/2 enabled that allows request smuggling and VCL authorization bypass. This article covers technical details, affected versions, and mitigation.

Published: February 25, 2026

CVE-2021-36740 Overview

CVE-2021-36740 is an HTTP Request Smuggling vulnerability affecting Varnish Cache when HTTP/2 is enabled. The flaw allows attackers to bypass VCL (Varnish Configuration Language) authorization controls by exploiting improper handling of the Content-Length header in POST requests. When a large Content-Length header is provided, the HTTP/2 implementation fails to properly validate request body boundaries, enabling request smuggling attacks that can circumvent security controls.

Critical Impact

Attackers can bypass VCL-based authorization controls, potentially gaining unauthorized access to protected resources or injecting malicious requests into backend server queues.

Affected Products

  • Varnish Enterprise 6.0.x before 6.0.8r3
  • Varnish Cache 5.x and 6.x before 6.5.2
  • Varnish Cache 6.6.x before 6.6.1
  • Varnish Cache 6.0 LTS before 6.0.8
  • Fedora 33 and 34
  • Debian Linux 10.0 and 11.0

Discovery Timeline

  • 2021-07-14 - CVE-2021-36740 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-36740

Vulnerability Analysis

This vulnerability exists in Varnish Cache's HTTP/2 request handling implementation. The core issue stems from the HTTP/2 protocol handler not properly accounting for the Content-Length header when processing request bodies. In HTTP/2, request body data is transmitted via DATA frames, which are separate from the HEADERS frame containing the Content-Length value. When these two values are inconsistent—particularly when a large Content-Length is specified but less data is actually sent—the Varnish Cache server fails to properly handle the discrepancy.

This desynchronization between the declared content length and the actual request body creates an HTTP Request Smuggling condition. An attacker can craft malicious requests that embed additional HTTP requests within the body, which the backend server interprets differently than the caching proxy, leading to authorization bypass scenarios.

Root Cause

The root cause is insufficient validation of the Content-Length header against actual request body bytes received in HTTP/2 DATA frames. The h2_req structure lacked tracking for received request body bytes (reqbody_bytes), preventing proper validation of the declared vs. actual content length. This allowed attackers to manipulate request boundaries and smuggle additional requests past VCL authorization rules.

Attack Vector

The attack vector is network-based and requires no authentication or user interaction. An attacker can exploit this vulnerability by:

  1. Establishing an HTTP/2 connection to a vulnerable Varnish Cache server
  2. Sending a POST request with a Content-Length header larger than the actual body content
  3. Embedding a smuggled HTTP request within the malformed request structure
  4. The smuggled request bypasses VCL authorization checks as it's processed out of the expected request context

The following patch commits show how the vulnerability was addressed by adding request body byte tracking to the h2_req structure:

c
 	/* Where to wake this stream up */
 	struct worker			*wrk;

+	ssize_t				reqbody_bytes;
+
 	VTAILQ_ENTRY(h2_req)		tx_list;
 	h2_error			error;
};

Source: GitHub Commit 82b0a629

The protocol handling was also updated to properly track content length:

c
    struct req *req, struct h2_req *r2)
{
 	h2_error h2e;
-	const char *b;
+	ssize_t cl;

 	ASSERT_RXTHR(h2);
 	assert(r2->state == H2_S_OPEN);

Source: GitHub Commit 9be22198

Detection Methods for CVE-2021-36740

Indicators of Compromise

  • Unusual HTTP/2 POST requests with abnormally large Content-Length headers compared to actual body size
  • VCL authorization log entries showing access to protected resources without proper authentication flow
  • Backend server logs showing unexpected or malformed requests that weren't logged by the Varnish frontend
  • HTTP/2 connection streams with mismatched content length and DATA frame totals

Detection Strategies

  • Monitor HTTP/2 traffic for POST requests where Content-Length exceeds the actual payload size
  • Implement log correlation between Varnish Cache and backend servers to identify request desynchronization
  • Deploy intrusion detection rules to flag HTTP/2 streams with suspicious content-length discrepancies
  • Review VCL authorization logs for access patterns that bypass expected authentication flows

Monitoring Recommendations

  • Enable detailed HTTP/2 protocol logging in Varnish Cache to capture header and body size metrics
  • Configure alerts for backend requests that lack corresponding frontend authorization records
  • Implement request integrity validation between Varnish and backend servers
  • Monitor for repeated connection patterns from single sources attempting HTTP/2 smuggling variations

How to Mitigate CVE-2021-36740

Immediate Actions Required

  • Upgrade Varnish Cache to version 6.5.2, 6.6.1, or 6.0.8 (LTS) or later immediately
  • For Varnish Enterprise, upgrade to version 6.0.8r3 or later
  • If immediate patching is not possible, disable HTTP/2 support temporarily
  • Review access logs for signs of exploitation attempts

Patch Information

Security patches are available through the official Varnish Cache project and distribution package managers. The vulnerability is tracked as Varnish Security Advisory VSV00007. Fixed versions include:

  • Varnish Cache 6.5.2 and later
  • Varnish Cache 6.6.1 and later
  • Varnish Cache 6.0.8 LTS
  • Varnish Enterprise 6.0.8r3

Distribution-specific advisories are available:

  • Debian Security Advisory DSA-5088
  • Fedora Package Announcements

Workarounds

  • Disable HTTP/2 support in Varnish Cache configuration if patching is not immediately possible
  • Implement additional request validation at the backend server level
  • Deploy a Web Application Firewall (WAF) with HTTP/2 request smuggling detection capabilities
  • Enforce strict Content-Length validation at the network perimeter
bash
# Disable HTTP/2 in Varnish Cache configuration
# Edit /etc/varnish/default.vcl or equivalent configuration file
# Remove or comment out HTTP/2 related parameters

# For systemd-based systems, modify the varnish service parameters
# Edit /etc/systemd/system/varnish.service or /lib/systemd/system/varnish.service
# Remove the -p feature=+http2 parameter from ExecStart

# Restart Varnish to apply changes
systemctl daemon-reload
systemctl restart varnish

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

  • Vulnerability Details
  • TypeAuth Bypass

  • Vendor/TechVarnish Cache

  • SeverityMEDIUM

  • CVSS Score6.5

  • EPSS Probability0.71%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-444
  • Technical References
  • Fedora Package Announcement

  • Fedora Package Announcement

  • Debian Security Advisory DSA-5088
  • Vendor Resources
  • Varnish Security Advisory VSV00007

  • GitHub Commit 82b0a629

  • GitHub Commit 9be22198

  • Varnish Security Advisory VSV00007
  • Related CVEs
  • CVE-2026-34475: Varnish Cache Auth Bypass Vulnerability

  • CVE-2026-40394: Varnish Cache DoS Vulnerability

  • CVE-2026-40396: Varnish Cache 9 DoS Vulnerability

  • CVE-2022-23959: Varnish Cache Request Smuggling Flaw
Default Legacy - Prefooter | 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