Skip to content

Rekor's compressed archives can result in OOM conditions

High severity GitHub Reviewed Published May 2, 2023 in sigstore/rekor • Updated Nov 7, 2023

Package

gomod github.com/sigstore/rekor (Go)

Affected versions

< 1.1.1

Patched versions

1.1.1

Description

Summary

Two vulnerabilities have been found in Rekor types for archive files JARs and APKs, where Rekor would crash due to out of memory conditions caused by reading archive metadata files into memory without checking their sizes first causing a Denial of Service of Rekor.

These vulnerabilities were found through fuzzing with OSS-Fuzz.

Vulnerability 1: OOM due to large files in META-INF directory of JAR files.

Summary

Verification of a JAR file submitted to Rekor can cause an out of memory crash if files within the META-INF directory of the JAR are sufficiently large.

Details

As part of verifying a JAR file, Rekor uses the relic library to check that the JAR is signed, the signature verifies, and that the hashes in the signed manifest are all valid. This library function reads files within META-INF/ into memory without checking their sizes, resulting in an OOM if the uncompressed file is sufficiently large. Rekor is also not performing any such checks prior to passing the JAR to this library function.

Patches

Users should update to the latest version of Rekor, 1.1.1.

Workaround

There are no workarounds, users should update.

Vulnerability 2: OOM due to large .SIGN and .PKGINFO files in APK files.

Summary

Parsing of an APK file submitted to Rekor can cause an out of memory crash if the .SIGN or .PKGINFO files within the APK are sufficiently large.

Details

When parsing an APK file, Rekor allocates byte slices to read both the .SIGN and .PKGINFO files into memory in order to verify the signature and hashes in the APK. These byte slices are allocated based on the size included in the tar header for each file, with no checks performed on that size. If the size in the header is sufficiently large, either because the uncompressed file is large or the size in the header has been artificially set to a large value, Rekor will crash due to an out of memory panic.

Patches

Users should update to the latest version of Rekor, 1.1.1.

Workaround

There are no workarounds, users should update.

References

@bobcallaway bobcallaway published to sigstore/rekor May 2, 2023
Published to the GitHub Advisory Database May 3, 2023
Reviewed May 3, 2023
Published by the National Vulnerability Database May 8, 2023
Last updated Nov 7, 2023

Severity

High

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
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

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:N/UI:N/S:U/C:N/I:N/A:H

EPSS score

0.158%
(53rd percentile)

Weaknesses

CVE ID

CVE-2023-30551

GHSA ID

GHSA-2h5h-59f5-c5x9

Source code

Credits

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