CVE-2025-51510: MoonShine SQL Injection Vulnerability in Blog Module
Summary
CVE-2025-51510: MoonShine SQL Injection Vulnerability. Affects moonshine/moonshine versions < 3.12.5. No fix is published. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
MoonShine is a popular PHP framework designed for building web applications with a focus on simplicity and flexibility. It provides a range of features including a robust blogging module, which allows users to create and manage blog content easily. However, the framework has been found to be vulnerable to SQL injection attacks, particularly in the Blog module, which can lead to unauthorized access to sensitive data.
Vulnerability Detail
The vulnerability identified as CVE-2025-51510 is a SQL injection flaw present in MoonShine version 3.12.5. This issue arises from improper handling of user input in the Data parameter of the Blog module, allowing attackers to manipulate SQL queries. If exploited, this vulnerability could enable attackers to execute arbitrary SQL commands, potentially leading to data leakage or corruption. The severity of this vulnerability is classified as moderate, with a CVSS score of 4.9.
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 sanitize and validate the input received in the Data parameter to prevent SQL injection. Implementing prepared statements or using ORM (Object-Relational Mapping) can also help mitigate the risk. For example, using PDO in PHP:
$stmt = $pdo->prepare('SELECT * FROM blog WHERE id = :id');
$stmt->execute(['id' => $inputId]);
Conclusion
The SQL injection vulnerability in MoonShine version 3.12.5 poses a significant risk to applications utilizing the framework's Blog module. It is crucial for developers to update to the latest version to mitigate this risk and ensure the security of their applications.
See every vulnerability recorded for moonshine/moonshine →
FAQ
CVE-2025-51510 is a SQL injection vulnerability found in the MoonShine framework, specifically in the Blog module.
You can check if your application is affected by using Vulert, which monitors open-source vulnerabilities in real-time. Visit Vulert Scanner to analyze your composer.lock file.
Exploitation of this vulnerability can lead to unauthorized access to sensitive data, data corruption, or even complete database compromise.
Yes, updating to the latest version of MoonShine will patch the vulnerability. Use the command composer update moonshine/moonshine.
The CVSS score for this vulnerability is 4.9, indicating a moderate level of severity.
References
Related vulnerabilities
Recent vulnerabilities recorded for moonshine/moonshine.