CVE-2018-10225: thinkphp SQL Injection via the index.php s parameter

topthink/framework Updated 02 Oct 2025

Summary

14/05/2022
No i
Critical
9.8

CVE-2018-10225: thinkphp SQL Injection via the index.php s parameter. Affects topthink/framework versions 3.1.3. No fix is published. 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The thinkphp package, specifically version 3.1.3, is an open-source PHP framework widely used for web application development. It provides a range of features and functionalities to simplify the development process. However, this version of thinkphp is vulnerable to SQL Injection through the 's' parameter in the index.php file.

Vulnerability Detail

The SQL Injection vulnerability in thinkphp 3.1.3 arises due to insufficient input validation and sanitization of the 's' parameter in the index.php file. An attacker can exploit this vulnerability by injecting malicious SQL queries into the 's' parameter, potentially leading to unauthorized access, data leakage, or manipulation of the underlying database. The severity of this vulnerability is rated as CRITICAL with a CVSS score of 9.8.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, developers can manually sanitize and validate the input provided through the 's' parameter in the index.php file. This can be achieved by implementing proper input validation and using parameterized queries or prepared statements to prevent SQL Injection attacks. Here is an example of how to sanitize the 's' parameter using PHP's built-in functions:

$s = $_GET['s'];
$s = filter_var($s, FILTER_SANITIZE_STRING);

Conclusion

In conclusion, thinkphp version 3.1.3 is vulnerable to SQL Injection through the 's' parameter in the index.php file. This vulnerability can have severe consequences, including unauthorized access and data manipulation. It is crucial to update the package to a patched version that addresses this issue. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for topthink/framework →

Share this vulnerability

FAQ

thinkphp is an open-source PHP framework used for web application development. It provides a range of features and functionalities to simplify the development process.

SQL Injection is a type of security vulnerability where an attacker can manipulate SQL queries to execute unauthorized actions on a database. In this case, the 's' parameter in thinkphp's index.php file is susceptible to SQL Injection.

Exploiting this vulnerability can lead to unauthorized access, data leakage, or manipulation of the underlying database. An attacker can execute arbitrary SQL queries, potentially compromising the confidentiality, integrity, and availability of the application and its data.

Yes, the maintainers of thinkphp have released a patched version that addresses this SQL Injection vulnerability. It is crucial to update the package to a version that includes the fix.

To prevent SQL Injection attacks, it is essential to implement proper input validation and sanitization techniques. Additionally, using parameterized queries or prepared statements can help mitigate the risk of SQL Injection vulnerabilities.

Related vulnerabilities

Recent vulnerabilities recorded for topthink/framework.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. 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