Coder Social home page Coder Social logo

CVE reported against 0.11.5 about jjwt HOT 5 CLOSED

jimshowalter avatar jimshowalter commented on June 7, 2024
CVE reported against 0.11.5

from jjwt.

Comments (5)

lhazlewood avatar lhazlewood commented on June 7, 2024 7

@jimshowalter just an update: the CVE reporter has agreed that this was an erroneously created CVE, and they've agreed to mark this CVE to REJECTED status (it is currently marked as DISPUTED). They've also deleted their test project that was previously located at https://github.com/2308652512/JJWT_BUG since it didn't reflect tests with any recently supported JJWT release. The Mitre team responsible for reviews should (to the best of my knowledge) change status to REJECTED relatively soon.

from jjwt.

lhazlewood avatar lhazlewood commented on June 7, 2024 6

This is not a security issue, and I disagree with the reporter's assessment.

Why wasn't the JJWT team contacted before creating a CVE? Even if it was a security issue, which this one is not, that's irresponsible reporting, preventing a possible fix being released before public disclosure.

This is an invalid CVE report for a number of reasons:

  1. The JJWT version used in the reporter's test code is more than 6 years old, probably a 0.9.x release, and has been unsupported for many years. The same tests run against later/current JJWT versions fail.

  2. The methods reported are already @Deprecated and documented accordingly because many people do not understand how to use Base64 in security contexts, presumably the CVE reporter as well.

  3. Base64 text in these contexts is not a key. It is an encoding of a key.. If someone generates a random string to use as a key directly, as the reporter did in their report (instead of generating an actual key and then Base64-encoding it), they're fundamentally subverting the security model. It's not a library's fault that the library user a) purposefully breaks their own security model and b) completely ignores both the JavaDoc documentation and compiler warnings for the corresponding methods.

  4. The preferred/recommended/documented methods accept an actual Key object, and have been in JJWT for many versions, long before 0.12. Interestingly, the reporter could create a valid Key by Base64-decoding their invalid test string and using the resulting raw bytes to create a Key object, and it's still the same problem. If you're purposefully trying to subvert your own key inputs, there's nothing a library can do about it.

  5. EVEN if the generated string was malformed, it's Base64-decoded length in bits MUST be large enough for the associated signature algorithm, otherwise an exception is thrown by JJWT (a WeakKeyException), meaning the security model defined in the JWA RFC is still maintained.

  6. The reporter was manipulating the key on the JWT creation side, again meaning the error is with the creation/issuer. As long as the key bit length is valid (and will be enforced per above), the generated JWT still reflects the intended security strength per the JWA RFC specification. It is not possible for the JWT recipient or man-in-the-middle to maliciously manipulate the JWT, retaining the associated algorithm's security properties, and it is still verifiable by any recipient with the same bit-for-bit decoded key.

We even have an entire section in our documentation about Base64 in security contexts, which also the CVE reporter either ignored or failed to acknowledge.

As such the CVE is invalid and reflection of an invalid test due to lack of understanding of JJWT's API, it's clear documentation on recommended practices and deprecation, and the still validly-maintained security properties of the associated signature algorithm.

It feels very much a scenario of 'let me see if I can come up with a test case that breaks something I think is invalid without understanding how to use the library or read it's documentation or even historical GitHub issues'. A simple communication with the JJWT team or cursory search would have easily identified the invalid test.

from jjwt.

jimshowalter avatar jimshowalter commented on June 7, 2024 1

There's some way to challenge CVEs, but I don't know what it is. Have seen some CVEs with rebuttals attached.

FWIW, I'm just letting you know about the CVE. Had nothing to do with it. Am not even qualified to evaluate it.

from jjwt.

jimshowalter avatar jimshowalter commented on June 7, 2024 1

Yes, we're fine. We have a way to override.

There's some info here about disputing CVEs: h2database/h2database#3686

from jjwt.

lhazlewood avatar lhazlewood commented on June 7, 2024

@jimshowalter thanks so much, I definitely appreciate it!

I'm assuming you're good to go on your respective projects then? Is there anything I can help answer for you regarding API usages?

from jjwt.

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.