Skip to content

[bugfix] Try Downgrading JWT libraries as a short term fix for JWT Token Verification Issue: Public Key Size Limitation #114

@akhilkh2000

Description

@akhilkh2000

Issue Description

In skill-tree backend, we use the io.jsonwebtoken/jjwt-api (version 0.11.2) package for verifying jwt tokens which does not allow 1024-bit public keys to be used (in line with the RFC) which is why we are unable to verify the token generated by “website-backend”.
Will try downgrading the package to a lower version which supports 1024 bit keys

More details - https://docs.google.com/document/d/1LGR3aXfj91dub4ZZaFY4oAVMZLliZZ3hmDPDcfFGYjo/edit

Expected Behavior

After downgrading the packages, the Auth protected API's should start working with the token generated using the public key used in website-backend (1024 bits)

Current Behavior

Verificiation of the token fails, as 1024 bit public keys are not supported by the JWT package used in skill-tree (this is in line with the latest RFC)

Screenshots

(io.jsonwebtoken.security.WeakKeyException)
image

Reproducibility

  • This issue is reproducible
  • This issue is not reproducible

Steps to Reproduce

  1. Get the auth cookie by following the steps mentioned below for local / staging:
  • Visit any auth protected api endpoint (Example /v1/skills) , you will get a 401 error with the following message:
    { "message": "The access token provided is expired, revoked, malformed, or invalid for other reasons." }

You can also verify the public key size exception (io.jsonwebtoken.security.WeakKeyException) message by checking the logs of the environment you are testing in.

Severity/Priority

  • Critical
  • High
  • Medium
  • Low

Additional Information

Checklist

  • I have read and followed the project's code of conduct.
  • I have searched for similar issues before creating this one.
  • I have provided all the necessary information to understand and reproduce the issue.
  • I am willing to contribute to the resolution of this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions