Click2Shell Vulnerability in WordPress Allows Hackers to Run PHP Code and Seize Control of Websites

Try Our Free Tools!
Master the web with Free Tools that work as hard as you do. From Text Analysis to Website Management, we empower your digital journey with expert guidance and free, powerful tools.

Significant Vulnerability Uncovered in WordPress: Click2Shell

A recently unveiled vulnerability within WordPress Core, termed Click2Shell, presents a harrowing risk whereby unauthenticated adversaries can covertly compel a logged-in Administrator’s browser to install a malicious theme.

This alarming sequence of events can culminate in remote code execution (RCE) with merely a single click on a deceptive link.

Researchers from PWNAI revealed that the theme-preview URL parameter in WordPress is interpreted inconsistently across two disparate components.

The WordPress.org Themes API effectively normalizes the theme parameter into a valid slug, whereas the JavaScript on the client side, located inwp-admin/js/theme.js, retains the attacker-supplied string in its raw form, directly injecting it into a jQuery CSS selector.

Analyzing the Click2Shell Flaw

By crafting a value such astwentytwenty"]>*>*>*/*, an attacker could navigate outside the intended selector bounds.

This maneuver permits the WordPress script to automatically activate the genuine “Install” button, bypassing any required admin interaction, nonce theft, or need for install_themes capabilities from the attacker’s side.

The compromised authenticated session, on its own, facilitates the installation of an authentic catalog theme without its activation.

PWNAI subsequently discovered that WordPress loads a theme’s functions.php file during the Customizer preview, even while the theme remains dormant.

When combined with an unrelated flaw in the (then-current) Mobile Repair Zone 2.5.4 theme, which featured an AJAX handler lacking nonce or capability verifications and accepted attacker-controlled plugin package URLs, the vulnerability escalated from forced installation to complete server-side PHP execution.

The resulting sequence of events is alarming: crafted link → compelled theme installation → Customizer loads code from the inactive theme → unprotected AJAX installer retrieves the attacker’s plugin → PHP executes under the web server account, effectively surrendering control of the entire site.

WordPress addressed the selector injection vulnerability in changeset 63664, part of the maintenance and security release issued on September 17, 2026, encompassing 11 crucial fixes.

This patch confines matches to authentic div.theme elements and applies $.escapeSelector() to neutralize the effects of injected selector syntax.

The research team at pwn.ai received recognition from WordPress and was awarded the maximum bug bounty, although no CVE identifier had been assigned at the point of disclosure.

Researchers categorized the isolated forced-install mechanism as High severity (CVSS 3.1: 7.1), while the complete exploit chain achieved a Critical rating (CVSS 3.1: 9.3), considering user interaction mitigates the impact.

This vulnerability affects all WordPress Core versions released before 7.1.1. Given that WordPress supports approximately 43% of the entire internet, translating to roughly 500 million websites, the breadth of this flaw is considerable, although its exploitation necessitates the presence of an additional theme-side vulnerability.

a close up of a typewriter with the word wordpress printed on it

Administrators are urged to promptly update to WordPress version 7.1.1 and conduct a thorough audit of installed themes, including inactive ones, in search of unauthenticated or inadequately protected AJAX handlers—a category of vulnerabilities identified in over 40 third-party catalog themes during the investigation.

Source link: Cyberpress.org.

Disclosure: This article is for general information only and is based on publicly available sources. We aim for accuracy but can't guarantee it. The views expressed are the author's and may not reflect those of the publication. Some content was created with help from AI and reviewed by a human for clarity and accuracy. We value transparency and encourage readers to verify important details. This article may include affiliate links. If you buy something through them, we may earn a small commission — at no extra cost to you. All information is carefully selected and reviewed to ensure it's helpful and trustworthy.

Reported By

Souvik Banerjee

I’m Souvik Banerjee from Kolkata, India. As a Marketing Manager at RS Web Solutions (RSWEBSOLS), I specialize in digital marketing, SEO, programming, web development, and eCommerce strategies. I also write tutorials and tech articles that help professionals better understand web technologies.
Share the Love
Related News Worth Reading