dromara / dromara/dataCompare

Vulnerability: SQL Injection in dataCompare ≤ 1.0.1

Open
#12 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
280
Forks
63
PR merge metrics
No merged PRs in 30d

Description

**BUG_Author:** R1ckyZ

**Affected Version:** dataCompare ≤ 1.0.1

**Vendor:** [dromara](https://github.com/dromara)

**Software:** [dataCompare](https://github.com/dromara/dataCompare)

**Vulnerability** **Files:**

- `src/main/java/com/vince/xq/project/tool/gen/controller/GenController.java`

## Description:

When executing a table creation SQL statement, the `/createTable` endpoint in `GenController` only checks whether the input is a `MySqlCreateTableStatement` but fails to properly sanitize or validate the table alias. This allows an attacker to inject malicious SQL payloads through the table alias, leading to SQL injection.

Image

## Proof of Concept:

1. After logging in, access the API `/tool/gen/createTable` and pass a statement vulnerable to SQL injection via POST parameters, as shown in the image below.

Image

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.