Coder Social home page Coder Social logo

Comments (10)

VojtechVitek avatar VojtechVitek commented on August 15, 2024

Sounds good.

We use our own Verifier middleware, so that's where the confusion came from. Good catch!

from jwtauth.

ernsheong avatar ernsheong commented on August 15, 2024

Any update? 😁 Seems like a semi-serious security flaw.

from jwtauth.

pkieltyka avatar pkieltyka commented on August 15, 2024

@ernsheong which default validations are missing besides checking validity of the signature, the algo matches and the token isn't expired? as in https://github.com/go-chi/jwtauth/blob/master/jwtauth.go#L109-L130

from jwtauth.

ernsheong avatar ernsheong commented on August 15, 2024

Something I can think of is the "aud" claim. Tricky but ideal is how can we let the caller handle this on their own without letting this library do all the heavy lifting.

from jwtauth.

pkieltyka avatar pkieltyka commented on August 15, 2024

@ernsheong in this case, as the docs suggest, you should write your own Verifier where the defaults aren't sufficient. But I don't see any security issues with the default, but as security issues are serious, it's nice to have a second set of eyes

from jwtauth.

ernsheong avatar ernsheong commented on August 15, 2024

Apologies, I might have overstated. Seems more acceptable now that I've studied it further.

Another separate concern is I'm not sure where this is coming from. Couldn't trace it from jwt-go:
https://github.com/go-chi/jwtauth/blob/master/jwtauth.go#L112

Also, the docs said to "write your own" Authenticator, so I assumed Verifier was supposed to not be customizable.

from jwtauth.

pkieltyka avatar pkieltyka commented on August 15, 2024

@ernsheong yea, good catch on that line. It's likely to do nothing at all, and was made to offer a more explicit error, but wouldn't be a security flaw. We should improve that for sure

from jwtauth.

ernsheong avatar ernsheong commented on August 15, 2024

@pkieltyka Thanks for the quick replies, created #29 to track that. Loving chi! Sorry for spamming this thread 😅

from jwtauth.

pkieltyka avatar pkieltyka commented on August 15, 2024

@ernsheong naw dude, thank you for giving it a look and submitting the concern, we can definitely improve it given the noop code :)

from jwtauth.

pkieltyka avatar pkieltyka commented on August 15, 2024

I'll close this so we can continue in #29

from jwtauth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.