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
    • 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-2023-36460

CVE-2023-36460: Mastodon Media Processing RCE Vulnerability

CVE-2023-36460 is a remote code execution vulnerability in Mastodon that allows attackers to create arbitrary files through crafted media uploads. This article covers the technical details, affected versions, and mitigation steps.

Published: February 11, 2026

CVE-2023-36460 Overview

CVE-2023-36460 is a critical Path Traversal vulnerability affecting Mastodon, the free, open-source social network server based on ActivityPub. Starting in version 3.5.0 and prior to versions 3.5.9, 4.0.5, and 4.1.3, attackers can exploit the media processing functionality using carefully crafted media files to create arbitrary files at any location on the server. This vulnerability enables attackers to create and overwrite any file that the Mastodon process has access to, leading to Denial of Service conditions and arbitrary Remote Code Execution.

Critical Impact

This vulnerability allows remote attackers to achieve arbitrary file creation and overwrite capabilities, enabling full Remote Code Execution on vulnerable Mastodon instances through malicious media file uploads.

Affected Products

  • Mastodon versions 3.5.0 through 3.5.8
  • Mastodon versions 4.0.0 through 4.0.4
  • Mastodon versions 4.1.0 through 4.1.2

Discovery Timeline

  • 2023-07-06 - CVE-2023-36460 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2023-36460

Vulnerability Analysis

The vulnerability resides in Mastodon's media processing pipeline, specifically within the Attachmentable concern that handles file attachments. The flaw allows attackers to craft malicious media files that bypass validation checks, enabling arbitrary file creation through path traversal techniques. When Mastodon processes the uploaded media, insufficient sanitization of file paths allows attackers to write files outside the intended upload directory.

The vulnerability is classified as CWE-22 (Path Traversal), where improper limitation of pathnames allows attackers to access or modify files outside restricted directories. Since Mastodon runs as a web service with specific file system permissions, an attacker can leverage this to overwrite configuration files, inject malicious code into executable paths, or disrupt service availability.

Root Cause

The root cause lies in the media attachment processing flow, where file name obfuscation and content type validation occurred after the file was already positioned for processing. The vulnerable code in app/models/concerns/attachmentable.rb processed files using before_post_process callbacks, which executed validation steps too late in the pipeline. This timing issue allowed specially crafted filenames to bypass security controls and write to arbitrary locations.

Attack Vector

An authenticated attacker with low privileges can exploit this vulnerability remotely over the network. The attack requires no user interaction and can impact resources beyond the vulnerable component's security scope. The attacker uploads a specially crafted media file containing path traversal sequences in the filename metadata. When Mastodon's media processing pipeline handles this file, it creates or overwrites files at attacker-controlled locations.

The security patch addresses this by moving validation to an earlier callback:

ruby
 
   included do
     def self.has_attached_file(name, options = {}) # rubocop:disable Naming/PredicateName
-      options = { validate_media_type: false }.merge(options)
       super(name, options)
-      send(:"before_#{name}_post_process") do
+
+      send(:"before_#{name}_validate") do
         attachment = send(name)
         check_image_dimension(attachment)
         set_file_content_type(attachment)
         obfuscate_file_name(attachment)
         set_file_extension(attachment)
-        Paperclip::Validators::MediaTypeSpoofDetectionValidator.new(attributes: [name]).validate(self)
       end
     end
   end

Source: GitHub Mastodon Commit

The fix also introduces enhanced media type spoof detection:

ruby
 require_relative '../lib/paperclip/attachment_extensions'
 require_relative '../lib/paperclip/lazy_thumbnail'
 require_relative '../lib/paperclip/gif_transcoder'
+require_relative '../lib/paperclip/media_type_spoof_detector_extensions'
 require_relative '../lib/paperclip/transcoder'
 require_relative '../lib/paperclip/type_corrector'
 require_relative '../lib/paperclip/response_with_limit_adapter'

Source: GitHub Mastodon Commit

Detection Methods for CVE-2023-36460

Indicators of Compromise

  • Unexpected file creation or modification in Mastodon's system directories outside the standard upload paths
  • Media upload requests containing path traversal sequences such as ../ or encoded variants in filenames
  • Anomalous file system activity by the Mastodon Ruby process writing to non-standard locations
  • New or modified files in configuration directories, cron paths, or other sensitive system locations

Detection Strategies

  • Monitor web server access logs for media upload requests with suspicious filename patterns containing traversal sequences
  • Implement file integrity monitoring (FIM) on critical system directories to detect unauthorized file creation or modification
  • Configure application-level logging to capture media processing operations and flag unusual file path patterns
  • Deploy web application firewall rules to detect and block path traversal patterns in multipart form uploads

Monitoring Recommendations

  • Enable verbose logging for the Paperclip attachment processing module in Mastodon
  • Set up alerts for file system events outside expected media storage directories attributed to the Mastodon process
  • Monitor for signs of Remote Code Execution such as unexpected process spawning or outbound network connections from the Mastodon server
  • Review media upload queues for files with suspicious metadata or naming conventions

How to Mitigate CVE-2023-36460

Immediate Actions Required

  • Upgrade Mastodon immediately to version 3.5.9, 4.0.5, or 4.1.3 depending on your current version branch
  • Review server file systems for signs of unauthorized file creation or modification that may indicate prior exploitation
  • Temporarily restrict media upload capabilities if immediate patching is not possible
  • Implement network-level controls to limit access to media upload endpoints while patching is underway

Patch Information

The Mastodon development team has released security patches addressing this vulnerability. The fix moves validation callbacks to execute during the before_validate phase rather than before_post_process, ensuring that file path sanitization and content type validation occur before any file system operations. Additionally, enhanced media type spoof detection has been added to the attachment processing pipeline.

Patched versions are available:

  • Version 3.5.9 for the 3.5.x branch
  • Version 4.0.5 for the 4.0.x branch
  • Version 4.1.3 for the 4.1.x branch

For technical details, see the GitHub Security Advisory GHSA-9928-3cp5-93fm.

Workarounds

  • Disable media uploads temporarily by configuring Mastodon to reject all attachment submissions until patching is complete
  • Implement strict file system permissions to limit the directories writable by the Mastodon process
  • Deploy a reverse proxy or WAF rule to filter requests containing path traversal patterns in upload endpoints
  • Run Mastodon in a containerized environment with restricted filesystem access to limit potential impact
bash
# Example: Restrict Mastodon process write permissions using systemd hardening
# Add to Mastodon service unit file
[Service]
ReadWritePaths=/opt/mastodon/public/system
ProtectSystem=strict
ProtectHome=true
NoNewPrivileges=true

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechMastodon

  • SeverityCRITICAL

  • CVSS Score9.9

  • EPSS Probability34.24%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-22
  • Technical References
  • Openwall Security Mailing List

  • GitHub Mastodon Release v3.5.9

  • GitHub Mastodon Release v4.0.5

  • GitHub Mastodon Release v4.1.3

  • GitHub Security Advisory GHSA-9928-3cp5-93fm
  • Vendor Resources
  • GitHub Mastodon Commit
  • Related CVEs
  • CVE-2026-33868: Mastodon Auth Bypass Vulnerability

  • CVE-2026-33869: Mastodon Authentication Bypass Vulnerability

  • CVE-2026-27477: Joinmastodon Mastodon SSRF Vulnerability

  • CVE-2026-27468: Joinmastodon Mastodon DOS Vulnerability
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