MEDIUM 6.4

CVE-2026-4804: Zakra WordPress Theme Stored XSS Vulnerability (Versions ≤4.2.0)

The Zakra WordPress theme contains a stored cross-site scripting (XSS) vulnerability affecting versions up to 4.2.0. An authenticated user with basic contributor permissions can inject malicious JavaScript into specific theme settings that gets saved and executed whenever anyone views the affected page. The vulnerability exists because the theme fails to validate user input through its REST API, even though it does sanitize input from the classic editor. This allows attackers to compromise visitor sessions and steal data without needing to exploit any other systems.

Source data · NVD / CISA · public domain

CVSS
3.1 · 6.4 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
Weaknesses (CWE)
CWE-79
Affected products
0 configuration(s)
Published / Modified
2026-07-03 / 2026-07-06

NVD description (verbatim)

The Zakra theme for WordPress is vulnerable to Stored Cross-Site Scripting via post meta values in all versions up to, and including, 4.2.0. This is due to the theme registering three post meta fields (zakra_menu_item_color, zakra_menu_item_hover_color, and zakra_menu_item_active_color) with 'show_in_rest' => true and 'auth_callback' => '__return_true', but without any sanitize_callback parameter in the register_post_meta() calls. While the classic editor save path applies sanitize_hex_color() sanitization, the REST API path completely bypasses this protection. The unsanitized meta values are then retrieved via get_post_meta() and concatenated directly into CSS strings that are output through wp_add_inline_style() without any escaping. This makes it possible for authenticated attackers, with Contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses the injected page.

2 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

Zakra registers three post meta fields (zakra_menu_item_color, zakra_menu_item_hover_color, zakra_menu_item_active_color) via register_post_meta() with REST API access enabled and an authentication callback that always returns true, but omits the sanitize_callback parameter. While the classic editor applies sanitize_hex_color() during save, the REST API path bypasses this entirely. Retrieved values are concatenated directly into inline CSS via wp_add_inline_style() without output escaping, allowing stored XSS for authenticated attackers at contributor level and above. The vulnerability chain combines insufficient input validation at the API boundary with missing output escaping in the rendering path.

Business impact

Organizations running Zakra-based sites face persistent XSS threats targeting site visitors. Compromised pages can harvest credentials, distribute malware, deface content, or redirect traffic. The attack requires initial compromise of a low-privileged account (contributor), making it a stepping stone in multi-stage intrusions. Unlike reflected XSS, the payload persists across sessions, affecting all visitors until remediated. Sites with public contributor access or weak account hygiene face elevated risk.

Affected systems

Zakra theme for WordPress, all versions through 4.2.0, is affected. The vulnerability requires REST API access (enabled by default in WordPress) and applies to any installation where contributors or higher-privileged users exist. Multisite installations where contributors can edit site options are particularly exposed. The vulnerability does not affect installations with REST API disabled or theme versions after 4.2.0 (pending confirmation of patched versions from the vendor).

Exploitability

Exploitability is moderate. An attacker must obtain contributor-level credentials or higher—achievable through credential compromise, account enumeration on public sites, or social engineering. No additional complexity exists once credentials are obtained; the REST API accepts unsanitized input without additional authentication factors. The attack is reliable and repeatable. However, the requirement for authenticated access prevents unauthenticated exploitation, and many organizations restrict contributor access, reducing real-world exposure in hardened environments.

Remediation

Update the Zakra theme to a patched version released after 4.2.0 that adds sanitize_callback to the meta field registration and applies output escaping to inline CSS. Organizations should verify the patched version number against the official Zakra release notes or vendor advisory before deployment. Interim mitigations include restricting REST API access if operationally feasible, disabling contributor-level permissions for untrusted users, or implementing Web Application Firewall rules to block REST API calls modifying these specific meta fields.

Patch guidance

Verify availability of a patched Zakra version beyond 4.2.0 in the official WordPress theme repository or vendor advisory. Apply updates through the WordPress admin dashboard or command line (e.g., wp theme update zakra). Test patched versions in a staging environment to confirm color settings render correctly and no functionality regresses. After deployment, audit post meta tables for suspicious hex values or encoded payloads injected during the vulnerability window. Consider reviewing contributor account activity logs during the exposure period.

Detection guidance

Monitor REST API POST/PUT requests to /wp-json/wp/v2/posts with meta parameters zakra_menu_item_color, zakra_menu_item_hover_color, or zakra_menu_item_active_color containing non-standard hex values (e.g., script tags, event handlers, or obfuscated JavaScript). Audit post meta values in the database for anomalies using queries filtering for these three fields. Review contributor account creation and permission grants. Implement log-based detection on wp_add_inline_style() calls that output suspicious CSS containing script references or event bindings. SIEM rules should flag REST API calls from unfamiliar IP addresses or user agents modifying theme-related meta fields.

Why prioritize this

While CVSS 6.4 (medium) reflects the authenticated requirement, organizational risk varies. This vulnerability warrants high priority for sites with public contributor registration, weak access controls, or high visitor traffic. For hardened environments with strict contributor management, priority is lower but still warrants patching within normal update cycles. The persistent nature of stored XSS and potential for large-scale visitor impact elevate practical risk beyond the base CVSS score.

Risk score, explained

CVSS 6.4 reflects: Low attack complexity (network-based REST API, no special conditions), requirement for low privileges (contributor access), scope change (attacks affect other users), and confidentiality/integrity impact (session compromise, page defacement). Lack of availability impact prevents higher severity. The score appropriately penalizes the authenticated requirement but does not account for deployment-specific factors (contributor access prevalence, visitor count, sensitivity of site data). Organizations should calibrate remediation urgency based on their actual attack surface and user populations.

Frequently asked questions

Can this vulnerability be exploited without a WordPress account?

No. The vulnerability requires authenticated access at contributor level or above. Unauthenticated visitors cannot inject the malicious payloads, but they are the targets of the resulting XSS attack once a payload is stored.

Does disabling the REST API prevent exploitation?

Yes. Disabling the REST API entirely blocks the unsanitized meta field endpoint. However, this is a blunt mitigation and may break other features or plugins that depend on REST API access. It is suitable as a temporary measure while awaiting patching.

Will updating WordPress alone fix this vulnerability?

No. This is a theme vulnerability, not a WordPress core issue. Updating WordPress does not patch Zakra. The theme itself must be updated to a patched version after 4.2.0.

How can I tell if my site was exploited?

Audit the post meta table for the three affected color fields containing suspicious values. Check web server logs for REST API requests modifying those fields during the exposure window. Review pages in the frontend for unexpected inline styles or script-like content in CSS output. Enable WordPress audit logging if available to track meta field changes.

This analysis is provided for informational purposes and represents the state of information as of the publication date. Patch version numbers and specific remediation steps should be verified against official vendor advisories before deployment. Organizations should conduct their own risk assessment based on their environment, user base, and deployment specifics. This explainer does not constitute legal, compliance, or professional security advice. Always test patches in non-production environments before production deployment. Source: NVD (public-domain), retrieved 2026-08-11. Analysis generated by SEC.co (claude-haiku-4-5).