Skip to content

Commit 1c6db3c

Browse files
authored
Update jwt-go to v4 to address CVE-2020-26160 (#69)
1 parent d783b5c commit 1c6db3c

File tree

7 files changed

+11
-9
lines changed

7 files changed

+11
-9
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# GO JWT Middleware
22

3+
**NOTE:** We released this version using a fork of jwt-go in order to address a security vulnerability. Due to jwt-go not being actively maintained we will be looking to switch to a more actively maintained package in the near future.
4+
35
A middleware that will check that a [JWT](http://jwt.io/) is sent on the `Authorization` header and will then set the content of the JWT into the `user` variable of the request.
46

57
This module lets you authenticate HTTP requests using JWT tokens in your Go Programming Language applications. JWTs are typically used to protect API endpoints, and are often issued using OpenID Connect.
@@ -28,7 +30,7 @@ import (
2830
"net/http"
2931

3032
"github.com/auth0/go-jwt-middleware"
31-
"github.com/dgrijalva/jwt-go"
33+
"github.com/form3tech-oss/jwt-go"
3234
"context"
3335
)
3436

@@ -70,7 +72,7 @@ import (
7072

7173
"github.com/auth0/go-jwt-middleware"
7274
"github.com/urfave/negroni"
73-
"github.com/dgrijalva/jwt-go"
75+
"github.com/form3tech-oss/jwt-go"
7476
"github.com/gorilla/mux"
7577
)
7678

examples/martini-example/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"net/http"
66

77
jwtmiddleware "github.com/auth0/go-jwt-middleware"
8-
"github.com/dgrijalva/jwt-go"
8+
"github.com/form3tech-oss/jwt-go"
99
"github.com/go-martini/martini"
1010
)
1111

examples/negroni-example/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"net/http"
66

77
jwtmiddleware "github.com/auth0/go-jwt-middleware"
8-
"github.com/dgrijalva/jwt-go"
8+
"github.com/form3tech-oss/jwt-go"
99
"github.com/gorilla/mux"
1010
"github.com/urfave/negroni"
1111
)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.14
44

55
require (
66
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 // indirect
7-
github.com/dgrijalva/jwt-go v3.2.0+incompatible
7+
github.com/form3tech-oss/jwt-go v3.2.2+incompatible
88
github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab
99
github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 // indirect
1010
github.com/gorilla/mux v1.7.4

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 h1:sDMmm+q/3+BukdIpxwO365v/Rbspp2Nt5XntgQRXq8Q=
22
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM=
3-
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
4-
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
3+
github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk=
4+
github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
55
github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab h1:xveKWz2iaueeTaUgdetzel+U7exyigDYBryyVfV/rZk=
66
github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8=
77
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=

jwtmiddleware.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"net/http"
99
"strings"
1010

11-
"github.com/dgrijalva/jwt-go"
11+
"github.com/form3tech-oss/jwt-go"
1212
)
1313

1414
// A function called whenever an error is encountered

jwtmiddleware_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"strings"
1010
"testing"
1111

12-
"github.com/dgrijalva/jwt-go"
12+
"github.com/form3tech-oss/jwt-go"
1313
"github.com/gorilla/mux"
1414
. "github.com/smartystreets/goconvey/convey"
1515
"github.com/urfave/negroni"

0 commit comments

Comments
 (0)