CVE-2021-24721

Loco Translate <= 2.5.3 - Authenticated PHP Code Injection

2021-10-11 00:00
Tomi Ashari

Strategic Overview

Status
Patched in 2.5.4
Affected Plugin
Loco Translate
Affected Version
< 2.5.4
CVSS
6.5Medium
Weakness type
CWE-94 · Improper Control of Generation of Code ('Code Injection')
CVE
CVE-2021-24721
View all Loco Translate vulnerabilities

At a glance

CVE-2021-24721 is a medium-severity Improper Control of Generation of Code ('Code Injection') vulnerability in the Loco Translate WordPress plugin, affecting versions < 2.5.4. It carries a CVSS score of 6.5 (reachable over the network; low attack complexity; high integrity impact). Exploitation requires an authenticated account. The issue is fixed in version 2.5.4; sites on affected versions should update now. Disclosed October 2021, reported by Tomi Ashari.

Vulnerability Overview

The Loco Translate WordPress plugin before 2.5.4 mishandles data inputs which get saved to a file, which can be renamed to an extension ending in .php, resulting in authenticated "translator" users being able to inject PHP code into files ending with .php in web accessible locations.

Technical Analysis

The vector marks this flaw as remotely reachable over the network, with low attack complexity — no special timing or configuration is needed, and no interaction from a victim user. A successful exploit has high impact on integrity.

CWE-94: Improper Control of Generation of Code ('Code Injection')

Loco Translate < 2.5.4 carries this weakness at translator, and reaching it takes any authenticated account. Code injection means input from a request reaches a language construct that evaluates code, so the attacker's text is executed rather than treated as data.

The injected code runs with the web server's privileges, giving the attacker the same access to the database and filesystem as WordPress itself. For Loco Translate the fix is 2.5.4: builds < 2.5.4 are affected, anything from 2.5.4 onward is not.

Remediation

Update to version 2.5.4, or a newer patched version

How does WordSec protect against this?

The attempt arrives as an ordinary request to Loco Translate: WordSec's web application firewall inspects request payloads before WordPress loads them. Classes like this one can leave something behind, so the staged malware scanner is the second half: it looks for dropped files and modified code rather than for the request that created them. None of that substitutes for the fix: Loco Translate 2.5.4 closes this, and updating the plugin is the step that ends it.

  • Firewall
  • Scanner
  • Alerts

External References

Related records

Vulnerability data © Defiant, Inc., provided under the Wordfence Intelligence T&C