dromara / dromara/ujcms

Ujcms v8.0.2 has a vulnerability that attacker could spoofing servers with IP addresses.

Open
#7 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
665
Forks
114
PR merge metrics
No merged PRs in 30d

Description

[Vulnerability description]

Ujcms v8.0.2 has a vulnerability that is Reliance on IP Address for Authentication(CWE-291), attacker could spoofing servers with IP addresses and impact log record.

[Vulnerability Type]
CWE-291: Reliance on IP Address for Authentication

[Vendor of Product]
https://gitee.com/ujcms/ujcms
https://github.com/ujcms/ujcms
https://www.ujcms.com/

[Affected Product Code Base]
v8.0.2

[Vulnerability proof]

Condition: tomcat deployment project
the weak java file : src/main/java/com/ujcms/commons/web/Servlets.java
1. The method to get a real client IP by X-Forwarded-For
![image](https://github.com/ujcms/ujcms/assets/152193131/59c55a9d-d33d-425f-802e-83a34e1ecb35)
2. If attacker add a `X-Forwarded-For: 1.1.1.1` in header, the IP list will be `1.1.1.1, 127.0.0.1`, now `getRemoteAddr()` will get the `127.0.0.1`
![image](https://github.com/ujcms/ujcms/assets/152193131/b922aeb1-19f9-4c73-a0e1-8a7e7b93822f)

![image](https://github.com/ujcms/ujcms/assets/152193131/560cf23a-ce23-4c53-a10c-af5cad249252)
3. And then find the ip from right to left, the left ip is 1.1.1.1
![image](https://github.com/ujcms/ujcms/assets/152193131/94c6d2a3-af4b-43a8-b814-6225b6f4c854)

The IP impersonation is complete

We can see the fake IP address in the log.
![image](https://github.com/ujcms/ujcms/assets/152193131/42d152dd-9cea-42e0-9de8-96eae73cf36e)
many Controllers use this weak method:
![image](https://github.com/ujcms/ujcms/assets/152193131/6b529006-7d76-465d-80c1-01f9ab85b2fa)

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.