Skip to content

Commit a46b5dd

Browse files
committed
chore: upgrade to golang-jwt 3.2.1 to fix CVE-2020-26160
CVE-2020-26160[0] is an access restriction bypass under certain circumstances when validating audience checks. The original dgrijalva/jwt-go project is no longer maintained[1] and will not be issuing a fix for this CVE[2]. Instead, they have transferred ownership to golang-jwt/jwt[2][3][4]. The following was performed: 1. update chronograf and jsonweb to import golang-jwt/jwt 2. go mod edit -require github.com/golang-jwt/[email protected]+incompatible 3. go mod edit -droprequire github.com/dgrijalva/jwt-go 4. go mod tidy 5. make 6. make test References: [0] https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-26160 [1] dgrijalva/jwt-go#462 [2] dgrijalva/jwt-go#463 [3] https://github.com/dgrijalva/jwt-go/blob/master/README.md [4] https://github.com/golang-jwt/jwt
1 parent e5c9c2d commit a46b5dd

File tree

7 files changed

+8
-5
lines changed

7 files changed

+8
-5
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Because of the version bump to `go`, the macOS build for this release requires a
3636
1. [21839](https://github.com/influxdata/influxdb/pull/21839): Fix display and parsing of `influxd upgrade` CLI prompts in PowerShell.
3737
1. [21898](https://github.com/influxdata/influxdb/pull/21898): Removed unused `chronograf-migator` package & chronograf API service, and updated various "chronograf" references.
3838
1. [21919](https://github.com/influxdata/influxdb/pull/21919): Fix display and parsing of interactive `influx` CLI prompts in PowerShell.
39+
1. [#](https://github.com/influxdata/influxdb/pull/#): Upgrade to golang-jwt 3.2.1 to fix CVE-2020-26160.
3940

4041
## v2.0.7 [2021-06-04]
4142
----------------------

chronograf/influx/authorization.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"net/http"
66
"time"
77

8-
jwt "github.com/dgrijalva/jwt-go"
8+
jwt "github.com/golang-jwt/jwt"
99
"github.com/influxdata/influxdb/v2/chronograf"
1010
)
1111

chronograf/influx/influx_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"testing"
1111
"time"
1212

13-
gojwt "github.com/dgrijalva/jwt-go"
13+
gojwt "github.com/golang-jwt/jwt"
1414
"github.com/influxdata/influxdb/v2/chronograf"
1515
"github.com/influxdata/influxdb/v2/chronograf/influx"
1616
"github.com/influxdata/influxdb/v2/chronograf/mocks"

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ require (
1414
github.com/buger/jsonparser v0.0.0-20191004114745-ee4c978eae7e
1515
github.com/cespare/xxhash v1.1.0
1616
github.com/davecgh/go-spew v1.1.1
17-
github.com/dgrijalva/jwt-go v3.2.0+incompatible
1817
github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8
1918
github.com/docker/docker v1.13.1 // indirect
2019
github.com/dustin/go-humanize v1.0.0
@@ -29,6 +28,7 @@ require (
2928
github.com/go-chi/chi v4.1.0+incompatible
3029
github.com/go-stack/stack v1.8.0
3130
github.com/gogo/protobuf v1.3.2
31+
github.com/golang-jwt/jwt v3.2.1+incompatible
3232
github.com/golang/gddo v0.0.0-20181116215533-9bd4a3295021
3333
github.com/golang/mock v1.5.0
3434
github.com/golang/protobuf v1.3.3

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a
216216
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
217217
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
218218
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
219+
github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c=
220+
github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
219221
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=
220222
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
221223
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=

jsonweb/token.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package jsonweb
33
import (
44
"errors"
55

6-
"github.com/dgrijalva/jwt-go"
6+
"github.com/golang-jwt/jwt"
77
"github.com/influxdata/influxdb/v2"
88
)
99

jsonweb/token_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"reflect"
55
"testing"
66

7-
"github.com/dgrijalva/jwt-go"
7+
"github.com/golang-jwt/jwt"
88
"github.com/google/go-cmp/cmp"
99
"github.com/influxdata/influxdb/v2"
1010
)

0 commit comments

Comments
 (0)