WordPress SQL Injection Vulnerability in $wpdb->prepare()

wordpress Updated 02 Oct 2025

Summary

04/11/2017
N/A
Yes i
Unrated
Not published

DLA-1160-1: wordpress - security update. Affects wordpress versions < 3.6.1+dfsg-1~deb7u18. Fixed in 3.6.1+dfsg-1~deb7u18. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

WordPress is a popular web blogging tool used for creating and managing websites. It provides a platform for users to publish and manage their content. The vulnerability in question affects the $wpdb->prepare() function in WordPress, which is used for preparing SQL queries. This function can create unexpected and unsafe queries, potentially leading to SQL injection (SQLi) attacks. This vulnerability can be exploited in plugins and themes, allowing an attacker to execute arbitrary SQL queries and potentially gain unauthorized access to the WordPress database.

Vulnerability Detail

The vulnerability arises from the improper usage of $wpdb->prepare() function in plugins and themes. By not properly sanitizing user input, an attacker can manipulate the SQL query and inject malicious code. This can lead to various consequences, including unauthorized access to the database, data manipulation, and potentially even remote code execution. It is important to note that this vulnerability is different from CVE-2017-14723. The fix for this vulnerability is included in version 3.6.1+dfsg-1~deb7u18 of the WordPress package for Debian 7 Wheezy.

How To Fix

Minimum fixed version

3.6.1+dfsg-1~deb7u18

This is the first release that contains the fix.

sudo apt-get install --only-upgrade wordpress

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Conclusion

The SQL injection vulnerability in $wpdb->prepare() function of WordPress can lead to potential unauthorized access to the database and other security risks. It is crucial to upgrade your WordPress packages to version 3.6.1+dfsg-1~deb7u18 or later to mitigate this vulnerability. For further support and assistance in vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for wordpress →

Share this vulnerability

FAQ

SQL injection is a type of security vulnerability where an attacker can insert malicious SQL code into a query, manipulating its behavior and potentially gaining unauthorized access to a database.

This vulnerability can be exploited by an attacker who has the ability to provide input to plugins or themes that use the vulnerable $wpdb->prepare() function. By manipulating the input, the attacker can inject malicious SQL code and potentially execute arbitrary queries.

The consequences of this vulnerability can vary depending on the specific implementation of WordPress and the plugins/themes in use. However, potential consequences include unauthorized access to the database, data manipulation, and potentially even remote code execution.

No, this vulnerability is not specific to Debian 7 Wheezy. It affects WordPress installations using versions prior to 3.6.1+dfsg-1~deb7u18. However, the fix mentioned in this advisory is specific to the Debian 7 Wheezy package.

You can find more information about Debian LTS security advisories, including how to apply updates and frequently asked questions, on the Debian LTS wiki: https://wiki.debian.org/LTS

Related vulnerabilities

Recent vulnerabilities recorded for wordpress.

How To Fix

Minimum fixed version

3.6.1+dfsg-1~deb7u18

This is the first release that contains the fix.

sudo apt-get install --only-upgrade wordpress

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback

Follow Vulert in Google

Get more Vulert vulnerability and dependency-security updates in Google Search and AI results.