VDB
Sign up
MEDIUM4.3

GHSA-c5q2-7r4c-mv6g

Go JOSE vulnerable to Improper Handling of Highly Compressed Data (Data Amplification)

Quick fix

GHSA-c5q2-7r4c-mv6g — github.com/go-jose/go-jose/v4: upgrade to the fixed version with the command below.

go get github.com/go-jose/go-jose/v4@v4.0.1

Details

### Impact An attacker could send a JWE containing compressed data that used large amounts of memory and CPU when decompressed by Decrypt or DecryptMulti. Those functions now return an error if the decompressed data would exceed 250kB or 10x the compressed size (whichever is larger). Thanks to Enze Wang@Alioth and Jianjun Chen@Zhongguancun Lab (@zer0yu and @chenjj) for reporting.

### Patches The problem is fixed in the following packages and versions: - github.com/go-jose/go-jose/v4 version 4.0.1 - github.com/go-jose/go-jose/v3 version 3.0.3 - gopkg.in/go-jose/go-jose.v2 version 2.6.3

The problem will not be fixed in the following package because the package is archived: - gopkg.in/square/go-jose.v2

Are you affected?

Enter the version of the package you're using.

Affected packages

Go/github.com/go-jose/go-jose/v4
Introduced in: 0Fixed in: 4.0.1
Fixgo get github.com/go-jose/go-jose/v4@v4.0.1
Go/github.com/go-jose/go-jose/v3
Introduced in: 0Fixed in: 3.0.3
Fixgo get github.com/go-jose/go-jose/v3@v3.0.3
Go/gopkg.in/go-jose/go-jose.v2
Introduced in: 0Fixed in: 2.6.3
Fixgo get gopkg.in/go-jose/go-jose.v2@v2.6.3
Go/gopkg.in/square/go-jose.v2
Introduced in: 0

No fixed version published yet for gopkg.in/square/go-jose.v2 (go modules). Pin to a known-safe version or switch to an alternative.

References