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-2022-25277

CVE-2022-25277: Drupal Core RCE Vulnerability

CVE-2022-25277 is a remote code execution vulnerability in Drupal Core affecting filename sanitization for htaccess files on Apache servers. This article covers the technical details, affected versions, and mitigation strategies.

Published: February 17, 2026

CVE-2022-25277 Overview

CVE-2022-25277 is an unrestricted file upload vulnerability affecting Drupal core that can lead to remote code execution on Apache web servers. The vulnerability stems from an interaction between two separate security mechanisms—filename sanitization for dangerous extensions and stripping of leading/trailing dots—that do not function correctly when used together. When both protections are active, files with .htaccess extensions may not be properly sanitized, potentially allowing attackers to bypass Drupal's default .htaccess security protections.

Critical Impact

Successful exploitation can result in remote code execution on Apache web servers by uploading malicious .htaccess files that bypass Drupal's default security configurations.

Affected Products

  • Drupal core (multiple versions)
  • Drupal CMS deployments on Apache web servers
  • Sites with file fields configured to allow .htaccess extensions

Discovery Timeline

  • 2023-04-26 - CVE-2022-25277 published to NVD
  • 2025-02-03 - Last updated in NVD database

Technical Details for CVE-2022-25277

Vulnerability Analysis

This vulnerability is classified under CWE-434 (Unrestricted Upload of File with Dangerous Type). The flaw exists in how Drupal core handles filename sanitization when multiple security measures interact. Drupal implements two distinct protections: one sanitizes filenames with dangerous extensions (implemented in SA-CORE-2020-012) and another strips leading and trailing dots to prevent server configuration file uploads (implemented in SA-CORE-2019-010).

When both protections are applied to a file upload, the interaction between these mechanisms creates a gap that allows .htaccess files to bypass sanitization. This can enable attackers to upload malicious Apache configuration files that override the security settings provided by Drupal's default .htaccess files.

Root Cause

The root cause lies in the order of operations and interaction between two separate security patches. The filename sanitization logic does not properly account for edge cases where both dangerous extension sanitization and dot-stripping occur on the same file. This creates a race condition of sorts in the sanitization pipeline, where the combination of transformations results in an improperly sanitized filename that retains the .htaccess extension.

Attack Vector

The attack vector is network-based and requires high privileges. An attacker must either:

  1. Have field administrator privileges to explicitly configure a file field to allow .htaccess as a permitted extension, or
  2. Exploit a contributed module or custom code that overrides the allowed file upload restrictions

Once this precondition is met, the attacker can upload a specially crafted file that exploits the sanitization bypass. The malicious .htaccess file can then modify Apache's handling of requests to the target directory, potentially enabling arbitrary PHP code execution through various Apache directives such as AddHandler or php_value.

The attack typically involves uploading an .htaccess file that enables PHP execution in normally restricted directories, followed by uploading a PHP webshell disguised with a permitted file extension.

Detection Methods for CVE-2022-25277

Indicators of Compromise

  • Unexpected .htaccess files appearing in Drupal's public file directories
  • File upload logs showing attempts to upload files with .htaccess extensions
  • Apache error logs indicating modified handler configurations
  • New or modified files in upload directories with unusual content

Detection Strategies

  • Monitor file upload events for any attempts to upload files containing htaccess in the filename
  • Implement file integrity monitoring on Drupal's default .htaccess files and upload directories
  • Review Drupal field configurations for any file fields permitting .htaccess extensions
  • Analyze web server access logs for suspicious requests to newly uploaded files

Monitoring Recommendations

  • Enable and centralize Drupal's watchdog logging for file upload operations
  • Configure web application firewall rules to block uploads containing Apache configuration directives
  • Implement real-time alerting for any modifications to .htaccess files within the Drupal webroot
  • Regularly audit file field configurations and contributed modules that modify upload permissions

How to Mitigate CVE-2022-25277

Immediate Actions Required

  • Update Drupal core to the latest patched version as specified in SA-CORE-2022-014
  • Audit all file field configurations to ensure .htaccess is not listed as an allowed extension
  • Review contributed modules and custom code for any overrides to file upload restrictions
  • Verify integrity of existing .htaccess files in Drupal directories

Patch Information

Drupal has released security updates addressing this vulnerability. Administrators should consult the official Drupal Security Advisory SA-CORE-2022-014 for specific version information and download links. Apply the appropriate patch based on your Drupal core version to resolve the sanitization bypass.

Workarounds

  • Remove .htaccess from all allowed file extension lists in Drupal field configurations
  • Implement Apache configuration to deny access to any .htaccess files in upload directories
  • Use web server-level restrictions to prevent execution of uploaded files regardless of extension
  • Consider moving to a non-Apache web server (e.g., Nginx) which does not process .htaccess files
bash
# Apache configuration to block .htaccess in upload directories
<Directory /var/www/drupal/sites/default/files>
    <FilesMatch "\.htaccess$">
        Require all denied
    </FilesMatch>
    # Disable PHP execution in upload directory
    php_admin_flag engine off
</Directory>

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechDrupal

  • SeverityHIGH

  • CVSS Score7.2

  • EPSS Probability0.28%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-434
  • Vendor Resources
  • Drupal Security Advisory SA-CORE-2022-014
  • Related CVEs
  • CVE-2020-13671: Drupal Core RCE Vulnerability

  • CVE-2024-55638: Drupal Core RCE Vulnerability

  • CVE-2024-55637: Drupal Core RCE Vulnerability

  • CVE-2024-55636: Drupal Core RCE 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