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

There is an Incorrect Access Control vulnerability in radar #100

Open
RacerZ-fighting opened this issue Dec 29, 2024 · 0 comments
Open

There is an Incorrect Access Control vulnerability in radar #100

RacerZ-fighting opened this issue Dec 29, 2024 · 0 comments

Comments

@RacerZ-fighting
Copy link

Version: <= 1.0.8

Branch: master

Problem: There is an authentication bypass vulnerability in radar. An attacker can exploit this vulnerability to access sensitive API without any token.

Source code Analysis

  1. The affected source code class is com.pgmmers.radar.intercpt.AuthInterceptor, and the affected function is preHandle. In the filter code, use request.getRequestURI() to obtain the request path.
image

Next, it checks whether the uri starts with /services and includes /user/login. If both conditions are met, it will be directly allowed.
2. The problem lies in using request.getRequestURI() to obtain the request path. The path obtained by this function will not parse special symbols, but will be passed on directly, so you can use ../ to bypass it.

Reproduce the vulnerablitity

Accessing http://ip:port/services/v1/datalist/1 directly will result in a failed response due to an empty token.
image

However, accessing http://ip:port/services/user/login/../../v1/datalist/1 will bypass the authentication check, and we can access any data info.
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