Skip to content
SQL injection Write-up Intermediate

Multiple WordPress Plugins SQL Injection Vulnerabilities

Nine WordPress plugins contained SQL injection flaws, mostly in ORDER BY clauses, because user input was not properly sanitised. An attacker could exploit these to execute arbitrary SQL statements, potentially stealing data or causing XSS.

fortinet.com

Published on fortinet.com

In July 2019, Fortinet’s FortiGuard Labs discovered and reported nine SQL injection vulnerabilities in nine different popular WordPress plugins across a variety of categories, including advertisement, donation, gallery, forms, newsletter, and video player. These plugins are being actively used by hundreds of thousands…

The author, on fortinet.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the plugins used user-supplied values in SQL ORDER BY clauses without proper validation or parameterisation, relying on escaping functions that do not prevent injection in that context.

Impact

An attacker could execute arbitrary SQL statements, potentially stealing sensitive information or causing cross-site scripting; however, some exploits required authentication and user interaction, and a web application firewall could block them.

What the attacker needed

WordPress site with a vulnerable plugin; For some plugins, an authenticated user account; For one plugin, no authentication but victim interaction

The fix

The vulnerabilities were fixed by adding quotes, whitelisting sort values, or correcting filters, and the text states all issues have been fixed and published by their respective vendors.

How it was found

  1. Authenticate to WordPress with a user role that can use the vulnerable plugin.
  2. Send a crafted request to the plugin's endpoint, manipulating a parameter used in an ORDER BY clause.
  3. Observe different responses to infer database information (blind SQL injection).

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

SQL injection is when a program builds a database query using untrusted input, letting an attacker change the query's meaning. Here, several WordPress plugins did this with sorting options, so a user could inject extra SQL commands. This could let an attacker read or change data in the site's database.

What is SQL injection?

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.

Similar reports

View all

Same bug class and techniques, clearest first.

SQL injection

The lesson behind this report.

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.