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
    • 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-2020-4047

CVE-2020-4047: WordPress Media File XSS Vulnerability

CVE-2020-4047 is a cross-site scripting flaw in WordPress that lets authenticated users inject malicious scripts into media attachments. This article covers the technical details, affected versions, and mitigation.

Published: March 4, 2026

CVE-2020-4047 Overview

CVE-2020-4047 is a stored Cross-Site Scripting (XSS) vulnerability affecting WordPress that allows authenticated users with upload permissions to inject malicious JavaScript into media file attachment pages. When a higher privileged user (such as an administrator) views the affected media file, the injected script executes in their browser context, potentially enabling privilege escalation, session hijacking, or unauthorized administrative actions.

Critical Impact

Authenticated attackers with author-level privileges can escalate their access by targeting administrators through crafted media uploads, potentially compromising the entire WordPress installation.

Affected Products

  • WordPress versions prior to 5.4.2 (and all legacy branches prior to their respective patched versions)
  • Fedora Project Fedora 32 and 33
  • Debian Linux 8.0, 9.0, and 10.0

Discovery Timeline

  • June 12, 2020 - CVE-2020-4047 published to NVD
  • November 21, 2024 - Last updated in NVD database

Technical Details for CVE-2020-4047

Vulnerability Analysis

This vulnerability (CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page) exists in how WordPress handles media file attachment pages. Authenticated users with upload permissions, including those with the "Author" role, can inject JavaScript code that persists within the attachment page. The malicious payload remains stored in the database and executes whenever the compromised attachment page is viewed.

The attack requires user interaction—specifically, a higher-privileged user must view the affected media attachment page. When they do, the injected script executes within their authenticated browser session, inheriting their elevated privileges.

Root Cause

The root cause lies in insufficient sanitization and output encoding of user-controlled data associated with media file attachments. WordPress failed to properly neutralize script-related HTML tags before rendering them on attachment pages, allowing stored XSS payloads to persist and execute.

Attack Vector

The attack vector is network-based and requires a low-privileged authenticated session. An attacker with author-level credentials can upload a media file with specially crafted metadata or content that includes malicious JavaScript. The vulnerability specifically targets the media file attachment page rendering process.

The attack flow involves:

  1. An attacker authenticates as a user with upload permissions (Author role or higher)
  2. The attacker uploads a media file with embedded malicious JavaScript
  3. When an administrator or higher-privileged user views the attachment page, the script executes
  4. The script can perform actions as the victim user, including creating new admin accounts or modifying site content

The vulnerability manifests in how WordPress processes and displays media attachment metadata. For technical implementation details, refer to the GitHub Security Advisory and the security patch commit.

Detection Methods for CVE-2020-4047

Indicators of Compromise

  • Unexpected JavaScript code present in media attachment page source code
  • Suspicious user activity patterns showing author-level users accessing admin functions
  • New administrator accounts created without authorized approval
  • Modified site settings or content following media file uploads from non-admin users

Detection Strategies

  • Monitor WordPress audit logs for unusual media upload patterns from author-level accounts
  • Implement Content Security Policy (CSP) headers to detect and block unauthorized script execution
  • Review media library entries for suspicious attachment metadata or descriptions
  • Deploy web application firewall (WAF) rules to detect XSS patterns in media uploads

Monitoring Recommendations

  • Enable detailed logging for all media upload operations including user context
  • Configure alerts for privilege escalation events or new admin account creation
  • Regularly scan media attachment pages for embedded script content
  • Monitor for changes to WordPress user roles and capabilities

How to Mitigate CVE-2020-4047

Immediate Actions Required

  • Update WordPress to version 5.4.2 or the latest patched version for your branch immediately
  • Review media library for any suspicious uploads from author-level users
  • Audit user accounts for unauthorized privilege changes or new administrator accounts
  • Consider temporarily restricting upload permissions to trusted users only

Patch Information

WordPress has released patches across all supported branches. Update to one of the following versions based on your current installation:

BranchPatched Version
5.4.x5.4.2
5.3.x5.3.4
5.2.x5.2.7
5.1.x5.1.6
5.0.x5.0.10
4.9.x4.9.15
4.8.x4.8.14
4.7.x4.7.18
Legacy (3.7-4.6)See WordPress Security Release

The fix is available in commit 0977c0d6b241479ecedfe19e96be69f727c3f81f.

Workarounds

  • Restrict media upload capabilities to administrator-only until patching is complete
  • Implement strict Content Security Policy headers to mitigate script execution
  • Use a Web Application Firewall (WAF) with XSS detection rules
  • Review and limit the number of users with upload permissions
bash
# WordPress CLI update command
wp core update

# Verify WordPress version after update
wp core version

# List users with upload capabilities for audit
wp user list --role=author --format=table
wp user list --role=editor --format=table

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

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechWordpress

  • SeverityMEDIUM

  • CVSS Score6.8

  • EPSS Probability6.18%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:N/I:H/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityHigh
  • AvailabilityNone
  • CWE References
  • CWE-80
  • Technical References
  • GitHub Security Advisory

  • Debian LTS Announcement July 2020

  • Debian LTS Announcement September 2020

  • Fedora Package Announcement 1

  • Fedora Package Announcement 2

  • Debian Security Advisory DSA-4709
  • Vendor Resources
  • GitHub Commit Changes

  • WordPress 5.4.2 Security Update
  • Related CVEs
  • CVE-2026-6504: Royal Elementor Addons XSS Vulnerability

  • CVE-2026-6174: CC Child Pages WordPress Plugin XSS Flaw

  • CVE-2026-6252: Meta Field Block WordPress Plugin XSS Flaw

  • CVE-2026-3694: Bold Page Builder WordPress XSS 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