Black Friday Sale is ON! Get 70% OFF All Certifications with Coupon: BF26-70-OFF

CVE-2026-109216 : Authenticated Stored XSS in Meta Box WordPress Plugin

Meta Box – A Framework for Dynamic Websites is one of the most popular and widely used custom fields frameworks in the WordPress ecosystem. It allows developers to create custom meta boxes, manage custom fields, and extend WordPress functionality across posts, pages, user profiles, taxonomies, and other content types. With support for over 40 field types, Meta Box provides a flexible solution for building dynamic WordPress websites without developing custom field management systems from scratch. The plugin currently has 500k+ active installations and over 25.2 million total downloads, making it a widely adopted framework among WordPress developers. Due to its extensive usage and integration with numerous themes and plugins, security vulnerabilities within Meta Box can potentially affect a significant number of WordPress websites.

The Vulnerability

During my security research, I identified an authenticated Stored Cross-Site Scripting (XSS) vulnerability in the Meta Box WordPress plugin, affecting versions 5.15.2 and earlier. The vulnerability exists in the built-in background field due to insufficient sanitization of user-controlled array keys and improper escaping during CSS generation.

The issue is in the RWMB_Sanitizer::sanitize_background() function, located in:

inc/sanitizer.php

The background field stores CSS properties such as color, image, repeat, attachment, position, and size as an associative array. The sanitizer uses wp_parse_args() to merge submitted values with the expected properties:

$value = wp_parse_args( $value, [
    'color'      => '',
    'image'      => '',
    'repeat'     => '',
    'attachment' => '',
    'position'   => '',
    'size'       => '',
] );

The function sanitizes the values of these properties, wp_parse_args() preserves unexpected array keys. As a result, an attacker can submit an additional key containing malicious HTML characters, which survives sanitization and is stored in the database.

The second part of the issue exists in RWMB_Background_Field::format_single_value(), located in:

inc/fields/background.php

This function converts stored background settings into CSS declarations. The relevant code is:

$value = array_filter( $value );

foreach ( $value as $key => $subvalue ) {
    $subvalue = 'image' === $key
        ? 'url(' . esc_url( $subvalue ) . ')'
        : esc_attr( $subvalue );

    $output .= 'background-' . $key . ': ' . $subvalue . ';';
}

While the function properly escapes the property values using esc_url() and esc_attr(), the array key ($key) is concatenated directly into the generated CSS without validation or escaping.

Meta Box's official documentation demonstrates rendering background styles directly inside an HTML style attribute using rwmb_the_value():

<div style="<?php rwmb_the_value( 'background' ); ?>">

When this rendering pattern is used, a malicious array key containing HTML attribute-breaking characters can escape the style attribute and inject executable JavaScript into the page.

Since the malicious key is stored in the database, the injected script persists and executes whenever another user visits the affected page.

An authenticated attacker, including a Subscriber where a consuming theme or plugin permits that role to modify the background field, can exploit this issue to execute JavaScript in a victim's browser.

The vulnerability does not automatically affect every Meta Box installation. Exploitation requires a plugin or theme that exposes the background field to the attacker and renders the stored value in the vulnerable HTML context.

Disclosure Timeline

  • Oct 10, 2026 : I reported the vulnerability to the Wordfence Intelligence Bug Bounty Program.
  • Oct 12, 2026 : The report was validated and CVE-2026-109216 was assigned.
  • Oct 28, 2026 : The CVE was disclosed publicly.

References

Written By
Photo of Md. Moniruzzaman Prodhan

Md. Moniruzzaman Prodhan

Director, Security Research & Programs

A cybersecurity professional working across training, security assessments, and research. Founder of the Knight Squad community and Director, Security Research & Programs at Knight Squad Academy. Has delivered cybersecurity training for multiple government agencies in Bangladesh, with hands-on experience in VAPT/penetration testing, malware analysis, reverse engineering, and AI security testing. Actively involved in responsible vulnerability research, including 0-day hunting, and contributes to the community as an event director and CTF challenge creator for KnightCTF and BDSec CTF.