question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warning about possible security issue

See original GitHub issue

Hello,

As you all know, JWT provides different way to encode and decode a token. Some of those algorithm are asymmetric and others symmetric. The fact that you can have both of them working together create a breach if you can access the public_key.

I’d like to know what you think about the idea of having a warning, or not allowing it at all, to have both a symmetric and asymmetric algorithm in the jwt.decode function.

Here you can find an example of case where you might have a security issue with your JWT.

Exemple: jwt

Actor 1:

  1. Request a JWT from the Auth server
  2. Contact App A with the JWT provided by Auth Server.
  3. App A will validate the JWT with the public key

Actor 2:

  1. Request a JWT from the Auth server
  2. Get the content and modify it
  3. generate a new JWT token signed with the public key and the algorithm “HS256”
  4. Contact the App A with the new JWT
  5. Because both Symmetric (HS256) and Asymmetric (RS256) are allowed together in App A, the new JWT is validated and accepted

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
nigorollcommented, Feb 24, 2020

OK, I understand your point now. A public key argument does not make sense for HS*

I agree that the interface could be improved, see also https://github.com/jpadilla/pyjwt/issues/408#issuecomment-586696809

1reaction
nigorollcommented, Feb 24, 2020

Making public a shared secret used for HS* is wrong.

Consequently, re-using a (published) public key for HS* is wrong.

Bluntly, I see no point in your scenario.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What do the security warning codes mean? | Firefox Help
Firefox shows you a warning page about a potential security risk when you try to connect to a secure site but your connection...
Read more >
Alerts - CISA
Alerts provide timely information about current security issues, vulnerabilities, and exploits. Sign up to receive these technical alerts in your inbox or ...
Read more >
Security Issues report - Search Console Help - Google Support
Here is a list of possible security issues, with information about how to fix each issue. Issues are classified as either errors or...
Read more >
National Terrorism Advisory System Bulletin
If You See Something, Say Something® Report suspicious activity and threats of violence, including online threats, to local law enforcement, FBI ...
Read more >
Apple's security flaw warning: What it means and what you ...
Apple released software updates that it says fix the exploits and warned users to download them as soon as possible. Advertisement. Here's what ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found