Skip to content

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

Moderate severity GitHub Reviewed Published Mar 7, 2024 in go-jose/go-jose • Updated Jun 12, 2024

Package

gomod github.com/go-jose/go-jose/v3 (Go)

Affected versions

< 3.0.3

Patched versions

3.0.3
gomod github.com/go-jose/go-jose/v4 (Go)
< 4.0.1
4.0.1
gomod gopkg.in/go-jose/go-jose.v2 (Go)
< 2.6.3
2.6.3
gomod gopkg.in/square/go-jose.v2 (Go)
<= 2.6.0
None

Description

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

References

@mcpherrinm mcpherrinm published to go-jose/go-jose Mar 7, 2024
Published to the GitHub Advisory Database Mar 7, 2024
Reviewed Mar 7, 2024
Published by the National Vulnerability Database Mar 9, 2024
Last updated Jun 12, 2024

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L

EPSS score

0.046%
(19th percentile)

Weaknesses

CVE ID

CVE-2024-28180

GHSA ID

GHSA-c5q2-7r4c-mv6g

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.