Connect with us

Hi, what are you looking for?

SecurityWeekSecurityWeek

Vulnerabilities

WordPress 5.1.1 Patches Remote Code Execution Vulnerability

WordPress this week addressed a vulnerability that could allow an unauthenticated attacker to execute code remotely and take over vulnerable websites. 

WordPress this week addressed a vulnerability that could allow an unauthenticated attacker to execute code remotely and take over vulnerable websites. 

The vulnerability impacts the manner in which comments are filtered and then stored in the database, and any WordPress installation prior to version 5.1.1 with comments enabled is vulnerable.

To exploit the vulnerability, an attacker would have to trick the site administrator to visit a domain to trigger a cross-site request forgery (CSRF) exploit in the background. The exploit leverages a series of logic flaws and sanitization errors to execute code and take over the target site, Simon Scannell of RIPS Technologies explains. 

The vulnerability is exploitable with default settings and, with most WordPress installations having comments enabled, millions of websites are likely impacted, the security researcher says. 

The core of the problem, Scannell explains, is that WordPress doesn’t perform CSRF validation when a user posts a new comment (features such as trackbacks and pingbacks would break if validations were in place), which allows an attacker to create comments in the name of administrators. 

Given that administrators are allowed to use arbitrary HTML tags in comments, even <script> tags, this lack of validation could become a critical issue, as an attacker could, in theory, abuse the CSRF to create a comment containing malicious JavaScript code.

“WordPress tries to solve this problem by generating an extra nonce for administrators in the comment form. When the administrator submits a comment and supplies a valid nonce, the comment is created without any sanitization. If the nonce is invalid, the comment is still created but is sanitized,” Scannell notes. 

The security researcher discovered that a logic flaw in the sanitization process could allow an attacker to create comments that contain “much more HTML tags and attributes than comments should usually be allowed to contain,” which could lead to a stored Cross-Site-Scripting (XSS) in the WordPress core. 

Advertisement. Scroll to continue reading.

This is possible because “some attributes that usually can’t be set in comments are parsed and manipulated in a faulty way that leads to an arbitrary attribute injection,” the researcher explains. 

An attacker could create a comment containing a crafted <a> tag to inject a stored XSS payload into the target website by chaining this sanitization flaw with the CSRF vulnerability. Next, the attacker needs to trick an administrator to execute the injected JavaScript, which can be done via a hidden <iframe> on the website of the attacker. 

“Remote Code Execution can be achieved easily. By default, WordPress allows administrators of a blog to directly edit the .php files of themes and plugins from within the admin dashboard. By simply inserting a PHP backdoor, the attacker can gain arbitrary PHP code execution on the remote server,” the researcher notes. 

The vulnerability was addressed in WordPress 5.1.1 and site admins are advised to apply the patch as soon as possible, provided that their installation is not set to auto-update (which is the default setting). 

Written By

Ionut Arghire is an international correspondent for SecurityWeek.

Click to comment

Trending

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest threats, trends, and technology, along with insightful columns from industry experts.

Join the session as we discuss the challenges and best practices for cybersecurity leaders managing cloud identities.

Register

SecurityWeek’s Ransomware Resilience and Recovery Summit helps businesses to plan, prepare, and recover from a ransomware incident.

Register

People on the Move

Cody Barrow has been appointed as CEO of threat intelligence company EclecticIQ.

Shay Mowlem has been named CMO of runtime and application security company Contrast Security.

Attack detection firm Vectra AI has appointed Jeff Reed to the newly created role of Chief Product Officer.

More People On The Move

Expert Insights

Related Content

Vulnerabilities

Less than a week after announcing that it would suspended service indefinitely due to a conflict with an (at the time) unnamed security researcher...

Data Breaches

OpenAI has confirmed a ChatGPT data breach on the same day a security firm reported seeing the use of a component affected by an...

IoT Security

A group of seven security researchers have discovered numerous vulnerabilities in vehicles from 16 car makers, including bugs that allowed them to control car...

Vulnerabilities

A researcher at IOActive discovered that home security systems from SimpliSafe are plagued by a vulnerability that allows tech savvy burglars to remotely disable...

Risk Management

The supply chain threat is directly linked to attack surface management, but the supply chain must be known and understood before it can be...

Cybercrime

Patch Tuesday: Microsoft calls attention to a series of zero-day remote code execution attacks hitting its Office productivity suite.

Vulnerabilities

Patch Tuesday: Microsoft warns vulnerability (CVE-2023-23397) could lead to exploitation before an email is viewed in the Preview Pane.

IoT Security

A vulnerability affecting Dahua cameras and video recorders can be exploited by threat actors to modify a device’s system time.