Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS02NzJwLW01anEtbXJoOM4AAv-o

Insufficient Verification of Proofs generated by the immudb server in client SDK.

Impact

In certain scenario a malicious immudb server can provide a falsified proof that will be accepted by the client SDK signing a falsified transaction replacing the genuine one. This situation can not be triggered by a genuine immudb server and requires the client to perform a specific list of verified operations resulting in acceptance of an invalid state value.

This vulnerability only affects immudb client SDKs, the immudb server itself is not affected by this vulnerability.

Detailed description

immudb uses Merkle Tree enhanced with additional linear part to perform consistency proofs between two transactions. The linear part is built from the last leaf node of the Merkle Tree compensating for transactions that were not yet consumed by the Merkle Tree calculation.

The Merkle Tree part is then used to perform proofs for things that are in transaction range covered by the Merkle Tree where the linear part is used to check those that are not yet in the Merkle Tree.

When doing consistency checks between two immudb states, the linear proof part is not fully checked. In fact only the first (last Merkle Tree leaf) and the last (current DB state value) are checked against new Merkle Tree without ensuring that elements in the middle of that chain are correctly added as Merkle Tree leafs.

This lack of check means that the database can present different set of hashes on the linear proof part to what would later be used once those become part of the Merkle Tree. This property can be exploited by the database to expose two different transaction entries depending on the other transaction that the user requested consistency proof for.

In practice this could lead to a following scenario:

Patches

The following Go SDK versions is not vulnerable:

SDK Version
go 1.4.1

Workarounds

Invalid proofs can not be generated in a normal immudb server and will be detected by a genuine replica server.
To ensure that the server does not produce invalid proofs and to check that the history presented by the server
does not contain falsified transactions, one should run a genuine immudb replica server in a safe environment
and fully synchronize all databases with the primary.

References

For more information

If you have any questions or comments about this advisory:

Permalink: https://github.com/advisories/GHSA-672p-m5jq-mrh8
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS02NzJwLW01anEtbXJoOM4AAv-o
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: over 1 year ago
Updated: 2 months ago


CVSS Score: 5.4
CVSS vector: CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:N/I:H/A:N

Identifiers: GHSA-672p-m5jq-mrh8, CVE-2022-36111
References: Repository: https://github.com/codenotary/immudb
Blast Radius: 8.5

Affected Packages

go:github.com/codenotary/immudb
Dependent packages: 36
Dependent repositories: 38
Downloads:
Affected Version Ranges: < 1.4.1
Fixed in: 1.4.1
All affected versions: 0.6.0, 0.6.1, 0.6.2, 0.7.0, 0.7.1, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.9.2, 1.0.0, 1.0.1, 1.0.5, 1.1.0, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.3.0, 1.3.1, 1.3.2, 1.4.0
All unaffected versions: 1.4.1, 1.5.0