[GH-ISSUE #2318] JWT Issue #1549

Closed
opened 2026-10-15 04:19:53 +07:00 by bsakaguchi · 9 comments
Owner

Originally created by @MagicAlan on GitHub (Nov 4, 2016).
Original GitHub issue: https://github.com/openwall/john/issues/2318

I have the following JWT (it is an example):

eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Rlc3QtdGVzdC50ZXN0ZXN0dGVzdC5jb20vIiwic3ViIjoidGVzdHwwMDAwMCIsImF1ZCI6ImZzZHJmTEtISkdZVGRmb3NpdXVUVUppdWZ5ZGd1cmZlIiwiZXhwIjoyNTQ0Nzc4NDU3LCJpYXQiOjI1NDQ3Nzg0NTcsImF6cCI6ImZzZHJmTEtISkdZVGRmb3NpdXVUVUppdWZ5ZGd1cmZlIn0.JLsq4NDG-SBY998TnuukyssQahWDqc-X5rXTifoMS8I

I tried to crack it using John the Ripper (Jumbo) but I got the following error:

Using default input encoding: UTF-8
No password hashes loaded (see FAQ)

Specifying "--format=HMAC-SHA256" I'm still getting the same error above.

If I try the example JWT token in the jwt.io site, I can successfully crack it. So, my guess would be that John is not loading the value because of its size?

Can anybody help me with this issue? thanks a lot!

Originally created by @MagicAlan on GitHub (Nov 4, 2016). Original GitHub issue: https://github.com/openwall/john/issues/2318 I have the following JWT (it is an example): eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3Rlc3QtdGVzdC50ZXN0ZXN0dGVzdC5jb20vIiwic3ViIjoidGVzdHwwMDAwMCIsImF1ZCI6ImZzZHJmTEtISkdZVGRmb3NpdXVUVUppdWZ5ZGd1cmZlIiwiZXhwIjoyNTQ0Nzc4NDU3LCJpYXQiOjI1NDQ3Nzg0NTcsImF6cCI6ImZzZHJmTEtISkdZVGRmb3NpdXVUVUppdWZ5ZGd1cmZlIn0.JLsq4NDG-SBY998TnuukyssQahWDqc-X5rXTifoMS8I I tried to crack it using John the Ripper (Jumbo) but I got the following error: Using default input encoding: UTF-8 No password hashes loaded (see FAQ) Specifying "--format=HMAC-SHA256" I'm still getting the same error above. If I try the example JWT token in the jwt.io site, I can successfully crack it. So, my guess would be that John is not loading the value because of its size? Can anybody help me with this issue? thanks a lot!
Author
Owner

@ghost commented on GitHub (Nov 4, 2016):

John is not loading the value because of its size?

Indeed, the check failing is in valid() line 240 of hmacSHA256_fmt_plug.c

if (strlen(ciphertext) > CT_LEN)
<!-- gh-comment-id:258517021 --> @ghost commented on GitHub (Nov 4, 2016): > John is not loading the value because of its size? Indeed, the check failing is in valid() line 240 of hmacSHA256_fmt_plug.c ``` if (strlen(ciphertext) > CT_LEN) ```
Author
Owner

@MagicAlan commented on GitHub (Nov 7, 2016):

Hi Claudio, i changed the value from CT_LEN in (esf_fmt_plug.c), but i'm still getting the same error..

<!-- gh-comment-id:258841250 --> @MagicAlan commented on GitHub (Nov 7, 2016): Hi Claudio, i changed the value from CT_LEN in (esf_fmt_plug.c), but i'm still getting the same error..
Author
Owner

@ghost commented on GitHub (Nov 7, 2016):

What I meant in the first place was:

  • the format developer built the format with this limit in mind. Unfortunately, it is not expected that a simple change like yours works.

It seems your encoded is a valid HS256 (https://jwt.io/) not supported by JtR now. That said, unless you are eager to put your hands on it, the issue is a warning/reminder to the developers.

<!-- gh-comment-id:258891244 --> @ghost commented on GitHub (Nov 7, 2016): What I meant in the first place was: - the format developer built the format with this limit in mind. Unfortunately, it is not expected that a simple change like yours works. It seems your encoded is a valid HS256 (https://jwt.io/) not supported by JtR now. That said, unless you are eager to put your hands on it, the issue is a warning/reminder to the developers.
Author
Owner

@MagicAlan commented on GitHub (Nov 7, 2016):

Alright Claudio, thank you.

<!-- gh-comment-id:258892765 --> @MagicAlan commented on GitHub (Nov 7, 2016): Alright Claudio, thank you.
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2016):

The correct fix was simply bumping SALT_LIMBS from 3 to 5. I have committed that just now in a366c37.

<!-- gh-comment-id:258909080 --> @magnumripper commented on GitHub (Nov 7, 2016): The correct fix was simply bumping SALT_LIMBS from 3 to 5. I have committed that just now in a366c37.
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2016):

Hmmm I added the 'enhancement' and 'Fixed - pending verify' labels. But it says MagicAlan did it. Are we facing Github data corruption? 😨

<!-- gh-comment-id:258915249 --> @magnumripper commented on GitHub (Nov 7, 2016): Hmmm I added the 'enhancement' and 'Fixed - pending verify' labels. But it says MagicAlan did it. Are we facing Github data corruption? 😨
Author
Owner

@jfoug commented on GitHub (Nov 7, 2016):

Could it have something to do with the emoji used? that is the first time I have seen that one. Possibly it corrupts the data which the php generates in some way, that 'keeps' the ownership of the emoji when showing the child item (the enhancement). I doubt it is corruption. Just a github.com interface bug.

<!-- gh-comment-id:258928565 --> @jfoug commented on GitHub (Nov 7, 2016): Could it have something to do with the emoji used? that is the first time I have seen that one. Possibly it corrupts the data which the php generates in some way, that 'keeps' the ownership of the emoji when showing the child item (the enhancement). I doubt it is corruption. Just a github.com interface bug.
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2016):

No, the emoji was added later.

<!-- gh-comment-id:258933626 --> @magnumripper commented on GitHub (Nov 7, 2016): No, the emoji was added later.
Author
Owner

@magnumripper commented on GitHub (Nov 7, 2016):

Anyway, I could easily crack the password of the sample so I'm closing this.

<!-- gh-comment-id:258933883 --> @magnumripper commented on GitHub (Nov 7, 2016): Anyway, I could easily crack the password of the sample so I'm closing this.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#1549
No description provided.