Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-52614 — There is a SQL injection vulnerability in the backend of Ruoyi v4.8.3 | Kitploit
Tools/GitHubGitHub/chinesespeople/cve-2026-52614
Password CrackingVulnerability AnalysisExploitationWeb Application ExploitationPenetration Testing
GitHubchinesespeople/cve-2026-52614

CVE-2026-52614

There is a SQL injection vulnerability in the backend of Ruoyi v4.8.3

View Repository
1111 month agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-52614 - RuoYi v4.8.3 filterKeyword Bypass SQL Injection

中文 | English

Authorization required / 仅限授权测试
This repository is intended for security research and authorized testing only. Do not use it against systems without explicit permission.
本仓库仅用于安全研究与已获明确授权的测试。请勿对未授权系统使用。

中文说明

漏洞简介

RuoYi v4.8.3 代码生成模块的 /tool/gen/createTable 接口允许后台用户提交建表 SQL。接口调用 SqlUtil.filterKeyword() 进行关键字黑名单过滤,但实现中先删除输入里的全部空白字符,再匹配包含尾随空格的关键字(例如 select 、insert 、drop ),导致相关规则无法命中。

通过 CREATE TABLE ... AS SELECT ...(CTAS)语句,可在通过 Druid MySqlCreateTableStatement 类型检查的同时执行 SELECT。具有有效后台会话的攻击者可据此构造布尔盲注,读取数据库中的敏感信息并创建数据表。

影响条件

  • 目标为 RuoYi v4.8.3。
  • 攻击者已登录后台并持有有效的 JSESSIONID。
  • 当前账号可以访问代码生成模块相关接口。
  • 数据库及当前数据库账号允许执行 CTAS 建表操作。

漏洞原理

验证脚本使用以下逻辑提取 sys_user 表中 admin 用户的密码哈希和 salt:

  1. 通过 CTAS 创建中间表,复制 login_name、password 和 salt 字段。
  2. 为每一个待判断字符创建测试表,并在 WHERE 中加入 SUBSTRING() 条件。
  3. 条件为真时,CTAS 返回数据,测试表不会被自动导入代码生成表列表。
  4. 条件为假时,CTAS 返回零行,测试表会被自动导入,可通过 /tool/gen/list 查询到。
  5. 根据测试表是否出现在列表中,逐字符恢复密码哈希和 salt。

环境要求

  • Python 3.8+
  • 有效且已授权的 RuoYi 后台会话
  • Python 依赖:requests、urllib3

安装依赖:

root@kitploit:~
python -m pip install requests urllib3

使用方法

打开 exp.py,修改顶部配置区中的以下两行:

root@kitploit:~
TARGET = "http://127.0.0.1:8080"
COOKIE = "JSESSIONID=your_session_id"

其中:

  • TARGET:替换为待测试的 RuoYi URL,例如 http://127.0.0.1:8080。
  • COOKIE:替换为登录后台后获得的有效 JSESSIONID session。

修改完成后直接运行:

root@kitploit:~
python exp.py

脚本会在目标数据库中创建中间表和大量布尔判断测试表。请仅在隔离或授权环境中使用,并在测试完成后由数据库管理员清理相关表。

验证截图

exp.png 为本地授权环境中的成功验证截图:

Successful verification

修复建议

  • 不要使用字符串黑名单判断 SQL 安全性,更不要直接执行用户提交的 SQL。
  • 修正 filterKeyword() 的规范化与匹配逻辑,但不要将其作为唯一防护。
  • 对代码生成接口实施严格的权限控制、操作审计和 CSRF 防护。
  • 禁止或移除任意 SQL 建表能力;如业务确有需要,应使用结构化参数构造固定语句。
  • 使用最小权限数据库账号,限制读取敏感表以及执行 CTAS/DDL 的权限。
  • 升级到官方已修复版本或应用官方安全补丁。

English

Summary

The /tool/gen/createTable endpoint in the code-generation module of RuoYi v4.8.3 accepts table-creation SQL from authenticated backend users. The endpoint calls SqlUtil.filterKeyword() to block dangerous SQL keywords. However, the implementation removes all whitespace from the input before checking blacklist entries that contain trailing spaces, such as select , insert , and drop . Those entries therefore cannot match the normalized input.

A CREATE TABLE ... AS SELECT ... (CTAS) statement can pass the Druid MySqlCreateTableStatement type check while still executing a SELECT. An attacker with a valid backend session may use this behavior for boolean-based blind SQL injection, sensitive-data extraction, and table creation.

Preconditions

  • The target runs RuoYi v4.8.3.
  • The tester has a valid authenticated backend JSESSIONID.
  • The authenticated account can access the code-generation endpoints.
  • The database and its configured account permit CTAS operations.

How the PoC Works

The script recovers the admin password hash and salt from sys_user using the following oracle:

  1. Create an intermediate table containing login_name, password, and salt.
  2. Create one test table per candidate character with a SUBSTRING() condition.
  3. When the condition is true, CTAS returns a row and the test table is not automatically imported into the generator table list.
  4. When the condition is false, CTAS returns zero rows and the table is automatically imported, making it visible through /tool/gen/list.
  5. Use that difference to recover the password hash and salt one character at a time.

Requirements

  • Python 3.8+
  • A valid, authorized RuoYi backend session
  • Python packages: requests, urllib3

Install dependencies:

root@kitploit:~
python -m pip install requests urllib3

Usage

Open exp.py and replace the following two lines in the configuration section near the top of the file:

root@kitploit:~
TARGET = "http://127.0.0.1:8080"
COOKIE = "JSESSIONID=your_session_id"

Where:

  • TARGET is the RuoYi base URL to test, for example http://127.0.0.1:8080.
  • COOKIE is a valid authenticated backend JSESSIONID session.

After replacing the URL and session, run:

root@kitploit:~
python exp.py

The script creates an intermediate table and many boolean-test tables in the target database. Use it only in an isolated or explicitly authorized environment, and have the database administrator remove the generated tables after testing.

Screenshot

exp.png shows a successful verification in an authorized local environment:

Successful verification

Mitigation

  • Do not rely on SQL keyword blacklists or execute user-supplied SQL directly.
  • Correct the normalization and matching logic in filterKeyword(), but do not treat it as the sole security control.
  • Apply strict authorization, auditing, and CSRF protection to code-generation endpoints.
  • Remove arbitrary SQL table creation; if required, construct fixed statements from structured, validated parameters.
  • Use a least-privileged database account that cannot read sensitive tables or perform unnecessary CTAS/DDL operations.
  • Upgrade to an officially fixed release or apply the vendor's security patch.

Files

  • exp.py - verification script / 验证脚本
  • exp.png - successful verification screenshot / 验证成功截图
  • README.md - bilingual vulnerability documentation / 中英双语漏洞说明
Download Tool