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.

huge webtokens being ingested over the wire

See original GitHub issue

using latest binaries as of today

    "koa-jwt": "3.5.1",
    "jsonwebtoken": "8.4.0",

koa-jwt had a typings issue whereby

audience: string

should have been

audience: string | string []

that was recently patched but not sent into the build yet https://github.com/koajs/jwt/issues/142

so I chose to patch it right in my node_modules directly

upon choosing to set my jwt_sign to ‘8 hrs’ or 2 or 3 anything in hrs

was sending massive webtokens back over the wire

sorry I dont have a repo to reproduce

and Im unsure to what extent the audience has to play in this

but there is potential for apps to be taken down by this huge webtoken

I switched my expiration to

const token = jwt.sign({user: entity}, this.privateKey, {expiresIn: '2 days'})

and all works ok now

this affected postman too made it hang

for minutes at a time

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
omsmithcommented, Feb 23, 2019

@ziluvatar @nhhockeyplayer That looks like a token that contains private information. You may want to remove it.

0reactions
omsmithcommented, Feb 26, 2019

Glad I was able to help. However, as a note, and while I don’t know your exact use-case, it’s usually not desirable to include the user’s password in the token. The token is not private data, just verifiable data.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Attacking JSON Web Tokens with Louis Nyffenegger - YouTube
SHOW SPONSOR ✨ ▭▭▭▭▭▭As a special offer for the OWASP DevSlop audience, sign up for a free 2-week Datadog trial and receive a...
Read more >
Documentation - Apache Kafka
The records in the partitions are each assigned a sequential id number called the offset that uniquely identifies each record within the partition....
Read more >
NIST Big Data Interoperability Framework: Volume 4, Security ...
This document reports on ITL's research, guidance, and outreach efforts in IT ... Certain types of data thought to be too big for...
Read more >
JSON Web Tokens (JWT) are Dangerous for User Sessions ...
Learn why JSON Web Token (JWT), although popular, is dangerous and also view a proposed battle-tested solution.
Read more >
Functions and Operators | CockroachDB Docs
Any function that might throw an error depending on the values of its arguments ... This function is intended to be used with...
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