Skip to content
SQL injection Write-up Intermediate

The Vulnerabilities

The WP Fastest Cache plugin contained an authenticated SQL injection where a user-supplied post ID was concatenated into a query after only a loose validation, and a CSRF flaw in a CDN settings AJAX action that lacked nonce checks, allowing stored XSS. An attacker with a low-privileged account could read privileged database information, and an attacker could trick a logged-in administrator into storing malicious JavaScript.

jetpack.com

Published on jetpack.com

During an internal audit of the WP Fastest Cache plugin, we uncovered an Authenticated SQL Injection vulnerability and a Stored XSS (Cross-Site Scripting) via Cross-Site Request Forgery (CSRF) issue.

The author, on jetpack.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

What the attacker needed

A logged-in WordPress account; classic-editor plugin active (SQLi only); victim admin visits attacker page (CSRF)

The fix

The vulnerabilities were fixed in version 0.9.5, which the author released after being contacted.

How it was found

  1. Log in to WordPress with any account that can trigger the admin_notices action.
  2. Send a request with a crafted post parameter that passes the published-post check but contains extra SQL.
  3. The plugin stores the raw value and later concatenates it into a database query.
  4. For the CSRF issue, an attacker creates a page that submits a request to the CDN settings AJAX action.
  5. A logged-in administrator visits the attacker's page, and the plugin saves the attacker-chosen CDN options, including script content.

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 user input is inserted into a database command without proper handling, letting an attacker change the command's meaning. Here, a number meant to identify a post was checked loosely and then pasted into a database query, so a logged-in user could add extra conditions to read other data. Separately, a settings-saving action checked that the user was an administrator but not that the request was intentionally made by that administrator, so a malicious page could make the admin's browser save harmful script content.

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.