Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 1.41 KB

File metadata and controls

34 lines (23 loc) · 1.41 KB

JWT Forgery

The user-auth-service of Unguard uses a vulnerable version of the library jwt-simple <0.5.3 that allows you to forge a JWT token to authenticate as another user.

Preconditions And Requirements

For this exploit to work you need:

Further details can be found in the user-auth-service project.

Exploitation

To forge a JWT token provide the desired usertag (a combination of username:userid) to the CLI after logging in with another user first.

Attention: The username and user ID have to match, otherwise the forged token will not have the right permissions.

$ ug-exploit login bob
$ ug-exploit forge-token admin:1

Now you can either use ug-exploit with the forged user (logged in automatically) or use the forged token, which is printed to the command-line manually.

You can now use this token and add it to the cookie named "jwt" as a value (for example in Chrome -> Developer Tools -> Application -> Cookies).