Skip to content
SQL injection Write-up Intermediate

CVE-2020–5766: SRS Simple Hits Counter Plugin — Information Disclosure

Three vulnerabilities were found in WordPress plugins: two blind SQL injections that could leak database contents, and a CSRF that could send forged emails. The SQL injection in Email Subscribers could lead to remote code execution if the WordPress database user is misconfigured with root privileges.

medium.com

Published on medium.com

This is a detailed overview of the bugs found while reviewing the source code of WordPress plugins. I cover 3 reported vulnerabilities (CVE-2020–5766, CVE-2020–5767 and CVE-2020–5768) which can be exploited for information disclosure and sending forged emails.

Alex Peña, on medium.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

User-supplied input was concatenated directly into SQL queries without proper sanitisation, and in one plugin a custom function removed WordPress's protective escaping.

What the attacker needed

No authentication for SRS plugin; Administrator privileges for Email Subscribers SQLi; Victim visits malicious page for CSRF; Database user with FILE privileges for RCE

The fix

The vulnerabilities were fixed in SRS Simple Hits Counter version 1.1.0 and Email Subscribers & Newsletters version 4.5.1.

How it was found

  1. Send an Ajax request to the srs_simple_hits_counter function with a crafted post_id parameter.
  2. Use a time-based blind SQL injection technique to extract database contents.
  3. For the Email Subscribers plugin, access the es-newsletters-settings-callback function as an administrator.
  4. Inject SQL through the broadcast_id parameter to leak database contents.
  5. If the database user has FILE privileges, use INTO OUTFILE to write a PHP script to the web directory.
  6. Trigger the SQL injection via a CSRF script that a logged-in administrator visits, then access the written PHP script to execute commands.

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 query without proper cleaning, letting an attacker change the query. Here, attackers could use delays to guess database contents, and one plugin also let an attacker make a logged-in admin send emails without knowing. A misconfigured database user with file-write rights could turn the SQL injection into running code on the server.

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.