auth0 / node-jws

JSON Web Signatures
http://self-issued.info/docs/draft-ietf-jose-json-web-signature.html
MIT License
709 stars 108 forks source link

Uncaught TypeError: Cannot read property 'from' of undefined #100

Closed ralpheichelberger closed 2 years ago

ralpheichelberger commented 3 years ago

Please do not report security vulnerabilities here. The Responsible Disclosure Program details the procedure for disclosing security issues.

Thank you in advance for helping us to improve this library! Please read through the template below and answer all relevant questions. Your additional work here is greatly appreciated and will help us respond as quickly as possible. For general support or usage questions, use the Auth0 Community or Auth0 Support. Finally, to avoid duplicates, please search existing Issues before submitting one here.

By submitting an Issue to this repository, you agree to the terms within the Auth0 Code of Conduct.

Description

When importing the jws library following Error occurs in the browser (chrome Version 90.0.4430.93 (Offizieller Build) (64-Bit) or chromium) console:

index.js:12 Uncaught TypeError: Cannot read property 'from' of undefined at index.js:12 at chunk.2VCUNPV2.js?v=3bdfb494:4 at sign-stream.js:2 at chunk.2VCUNPV2.js?v=3bdfb494:4 at index.js:2 at chunk.2VCUNPV2.js?v=3bdfb494:4 at dep:jws:1

When debugging it seams that "safe-buffer" in index.js at line 4 "buffer.Buffer" is not defined.

Reproduction

npm init @vitejs/app testjws // choose vanilla and javascript (also with vue) npm install jws add: import jws from 'jws' npm run dev

Environment

I am using vitejs 7.7.6 on Ubuntu 20.04 LTS, nodejs v15.14.0 with vue-next/vue3. jws latest (4.0.0)

Please provide the following: