CVE-2023-49371: RuoYi SQL Injection Vulnerability

com.ruoyi:ruoyi Updated 02 Oct 2025

Summary

01/12/2023
No i
Critical
9.8

CVE-2023-49371: RuoYi vulnerable to SQL injection vulnerability. Affects com.ruoyi:ruoyi versions < 4.6. 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

RuoYi is an open-source package available on Maven that provides a comprehensive framework for building enterprise-level applications. It offers various features and functionalities to facilitate the development process. However, RuoYi versions up to v4.6 have been found to be vulnerable to a SQL injection attack. This vulnerability can be exploited through the '/system/dept/edit' endpoint.

Vulnerability Detail

The SQL injection vulnerability in RuoYi allows an attacker to manipulate SQL queries by injecting malicious input. By exploiting this vulnerability, an attacker can execute arbitrary SQL commands, potentially gaining unauthorized access to the database or modifying its contents. This can lead to data breaches, data manipulation, or even complete system compromise. The vulnerability has been assigned a severity rating of HIGH.

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

If upgrading to a newer version is not immediately feasible, a temporary workaround can be implemented by validating and sanitizing user input before using it in SQL queries. This can be achieved by using parameterized queries or prepared statements, which ensure that user input is treated as data rather than executable code. Here is an example of how to use prepared statements in Java:

// Assuming 'conn' is the database connection
String sql = "SELECT * FROM users WHERE username = ? AND password = ?";
PreparedStatement statement = conn.prepareStatement(sql);
statement.setString(1, username);
statement.setString(2, password);
ResultSet resultSet = statement.executeQuery();
// Process the result set

By using prepared statements, the input is automatically escaped and treated as data, mitigating the risk of SQL injection.

Conclusion

The SQL injection vulnerability in RuoYi versions up to v4.6 poses a significant risk to the security and integrity of the application and its underlying database. It is crucial to promptly upgrade to a newer version that addresses this vulnerability. If immediate upgrading is not feasible, implementing proper input validation and sanitization techniques can serve as a temporary workaround. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for com.ruoyi:ruoyi →

Share this vulnerability

FAQ

RuoYi is an open-source package available on Maven that provides a comprehensive framework for building enterprise-level applications. It offers various features and functionalities to facilitate the development process.

A SQL injection vulnerability allows an attacker to manipulate SQL queries by injecting malicious input. This can lead to unauthorized access to the database, data breaches, data manipulation, or even complete system compromise.

This vulnerability in RuoYi can be exploited by sending specially crafted input through the '/system/dept/edit' endpoint. The attacker can inject SQL commands that will be executed by the application, potentially compromising the database.

The impact of this vulnerability can be severe. An attacker can gain unauthorized access to the database, extract sensitive information, modify data, or even delete the entire database. This can lead to financial loss, reputational damage, and legal consequences.

To protect your application from this vulnerability, it is recommended to upgrade RuoYi to a version beyond v4.6. Additionally, always validate and sanitize user input before using it in SQL queries. Using parameterized queries or prepared statements can help mitigate the risk of SQL injection.

Related vulnerabilities

Recent vulnerabilities recorded for com.ruoyi:ruoyi.

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