# Why JWT verify tampered tokens?

**URL:** <https://community.auth0.com/t/why-jwt-verify-tampered-tokens/17441>\
**Category:** JWT.io\
**Created:** [October 31, 2018, 1:57pm UTC](https://community.auth0.com/t/why-jwt-verify-tampered-tokens/17441 "2018-10-31T13:57:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gamero.sa](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gamero.sa/32/9500_2.png) [@gamero.sa](https://community.auth0.com/u/gamero.sa)\
**Post date:** [October 31, 2018, 1:57pm UTC](https://community.auth0.com/t/why-jwt-verify-tampered-tokens/17441/1 "2018-10-31T13:57:46Z")

</div>

Hey,!

I’ve been doing tests with [jwt.io](http://jwt.io) token example and I don’t get why JWT Debugger verifies this token:  
_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV\_adQssw5 **c** _

and also this one:  
_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV\_adQssw5 **f** _

with the same secret key (“your-256-bit-secret”). I must be missing something, can anyone explain it to me?

Thanks.

---

<div class="post-metadata">

**Author:** ![john.gateley](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/john.gateley/32/10879_2.png) [@john.gateley](https://community.auth0.com/u/john.gateley)\
**Post date:** [October 31, 2018, 2:04pm UTC](https://community.auth0.com/t/why-jwt-verify-tampered-tokens/17441/2 "2018-10-31T14:04:55Z")

</div>

This is just a guess, but the two tokens differ ONLY in the last two bits:  
0xC = 1100  
0xF = 1111  
I would guess these last two bits are not really part of the payload.  
If we do 0x8 as the last bit (1000) the signature is invalid.  
If we do D and E, the signature is also verified.  
So, I’d guess these are just unused bits.

John

---

<div class="post-metadata">

**Author:** ![markd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/markd/32/38919_2.png) [@markd](https://community.auth0.com/u/markd)\
**Post date:** [October 31, 2018, 8:22pm UTC](https://community.auth0.com/t/why-jwt-verify-tampered-tokens/17441/3 "2018-10-31T20:22:36Z")

</div>

You can replace that last character with a ‘c’, ‘d’, ‘e’, or ‘f’ and it is considered valid. Anything else and it is invalid. No idea why though.

---

<div class="post-metadata">

**Author:** ![James.Morrison](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/james.morrison/32/13507_2.png) [@James.Morrison](https://community.auth0.com/u/James.Morrison)\
**Post date:** [November 5, 2018, 7:34pm UTC](https://community.auth0.com/t/why-jwt-verify-tampered-tokens/17441/5 "2018-11-05T19:34:45Z")

</div>

I wanted to reach out and let you know to please feel free to visit us again if you have any additional questions @gamero.sa! Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [December 5, 2018, 7:34pm UTC](https://community.auth0.com/t/why-jwt-verify-tampered-tokens/17441/6 "2018-12-05T19:34:47Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
