You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an authentication bypass vulnerability in jobx. An attacker can exploit this vulnerability to access sensitive API without any token.
Sourcecode Analysis
The affected source code class is com.jobxhub.server.handler.SecurityHandlerInterceptor, and the affected function is preHandle. In the filter code, use request.getContextPath() + request.getServletPath() to obtain the request path,
and then determine whether the requestURI is static resources. If it is a static resource, it will be directly allowed.
2. The problem lies in using request.getContextPath() to obtain the context 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.
The prerequisite for the vulnerability exploitation is that the contextPath configuration is non-empty. Here, it is exemplified with /demo.Taking one of the backend interfaces as an example(full path in case is /demo/user/get.do), using /login/../demo/user/get.do can make it satisfy static resource, and at the same time, it can request the /user/get.do interface to achieve login bypass.
Reproduce the vulnerablitity
Accessing http://ip:port/demo/user/get.do directly will result in an redirect.
However, accessing http://ip:port/login/../demo/user/get.do will bypass the authentication check, and we can access any user info.
The text was updated successfully, but these errors were encountered:
Version: <= v1.0.1-RELEASE
Brach: main
Problem:
There is an authentication bypass vulnerability in jobx. An attacker can exploit this vulnerability to access sensitive API without any token.
Sourcecode Analysis
com.jobxhub.server.handler.SecurityHandlerInterceptor
, and the affected function ispreHandle
. In the filter code, userequest.getContextPath() + request.getServletPath()
to obtain the request path,and then determine whether the
requestURI
is static resources. If it is a static resource, it will be directly allowed.2. The problem lies in using
request.getContextPath()
to obtain the context 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.The prerequisite for the vulnerability exploitation is that the
contextPath
configuration is non-empty. Here, it is exemplified with/demo
.Taking one of the backend interfaces as an example(full path in case is/demo/user/get.do
), using/login/../demo/user/get.do
can make it satisfy static resource, and at the same time, it can request the/user/get.do
interface to achieve login bypass.Reproduce the vulnerablitity
Accessing
![image](https://private-user-images.githubusercontent.com/78632303/398082184-c0a21bc4-3433-48e9-8aef-00cb9f926f94.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwNTczMDUsIm5iZiI6MTczOTA1NzAwNSwicGF0aCI6Ii83ODYzMjMwMy8zOTgwODIxODQtYzBhMjFiYzQtMzQzMy00OGU5LThhZWYtMDBjYjlmOTI2Zjk0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDIzMjMyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWEwMWZkM2I5MGVkNTE1MmUzNGYxNTJiY2IxMmQ5N2Y3MGEzMWMxNDRmZTkwOWQ3NDZlY2FlODg4M2I4MmM4YzkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.oxp0Awcszfe6PvRbBti9FvzsLcg9kTtRB6Et45wX6mA)
http://ip:port/demo/user/get.do
directly will result in an redirect.However, accessing
![image](https://private-user-images.githubusercontent.com/78632303/398082429-31fbf4c8-73b2-4513-b214-2f075ff1bc51.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwNTczMDUsIm5iZiI6MTczOTA1NzAwNSwicGF0aCI6Ii83ODYzMjMwMy8zOTgwODI0MjktMzFmYmY0YzgtNzNiMi00NTEzLWIyMTQtMmYwNzVmZjFiYzUxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDIzMjMyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNiYmI1YTRlMGQ1M2QzNTFhYjY4MTdlNzBiNGYyZGRkYmMxOTVjMjQ0MmIyMjIxNTg5ZjFmZjhjYTAzYmEzM2EmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ZUYGsiPBPWgFZazlknjA4ZsUIYuTdol832u2H75Z6Ww)
http://ip:port/login/../demo/user/get.do
will bypass the authentication check, and we can access any user info.The text was updated successfully, but these errors were encountered: