Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Phantom4me opened this issue Dec 17, 2023 · 0 comments

Comments

@Phantom4me
Copy link

Phantom4me commented Dec 17, 2023

[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
  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

image
3. And then find the ip from right to left, the left ip is 1.1.1.1
image

The IP impersonation is complete

We can see the fake IP address in the log.
image
many Controllers use this weak method:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant