Skip to content

Memory exhaustion when decrypting untrusted INI or DotEnv files

Moderate
felixfontein published GHSA-hqjv-fvgv-rh27 Aug 14, 2026

Package

gomod github.com/getsops/sops/v3 (Go)

Affected versions

< 3.13.0

Patched versions

3.13.0

Description

Impact

When storing metadata in encrypted INI or DotEnv files, SOPS flattens metadata. Since metadata can contain lists, the unflattening code makes sure that lists are resized appropriately to be able to contain an index extracted from a metadata key. For example, if a element with key a__list_20000000 is found, SOPS makes sure that the list stored under key a has at least 20000001 elements.

By crafting a simple INI or DotEnv file that contains an extremely large list index in the metadata, SOPS can be tricked into allocating a huge amount of memory. This can be used for Denial of Service attacks, in particular if SOPS is embedded in another application.

Patches and mitigations

SOPS 3.13.0 contains a rewrite of the unflattening code that collects all metadata keys in a tree structure before attempting to allocate a list. If a set of list of non-consecutive list indices is found, our a list not starting at 1, SOPS will abort unflattening the metadata and not allocate a list to accomodate these list indices.

For SOPS < 3.13.0, users should avoid to decrypt untrusted INI and DotEnv files.

References

For more information

If you have any questions or comments about this advisory:

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
None
User interaction
Required
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:R/S:U/C:N/I:N/A:H

CVE ID

No known CVE

Weaknesses

No CWEs

Credits