8000 Example code is memory insecure · Issue #60 · golang-jwt/jwt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Example code is memory insecure #60
Open
@lggomez

Description

@lggomez

Migrated from dgrijalva/jwt-go#441:

Comments
@gardc
gardc commented on Nov 21, 2020 •

Referring to this example (https://godoc.org/github.com/dgrijalva/jwt-go#example-Parse--Hmac) pointed to by the readme, feeding it an invalid JWT will create a memory panic.

Go playground example. (https://play.golang.org/p/wyOgm21FYE8)

Checking for err and token.Valid before assuming it's all good in the hood fixes the issue, Go playground example. (https://play.golang.org/p/0sX-54gXfE2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0