Vulnerabilities in pkg:golang/github.com/codenotary/immudb

PACKAGE
Advisory Identifier: GHSA-672p-m5jq-mrh8
Advisory Summary

CVE-2022-36111 is a MODERATE (CVSS 5.4) insufficient verification of proofs generated vulnerability (CWE-345: Insufficient Verification of Data Authenticity) affecting Github.com/codenotary/immudb libraries in the Go ecosystem. The issue involves insufficient verification of proofs generated by the immudb server in client sdk.. Remediation is available by upgrading affected packages to version 1.4.1.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/codenotary/immudb

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/codenotary/immudb. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-672p-m5jq-mrh8 CVE-2022-36111 MODERATE Insufficient Verification of Proofs generated by the immudb server in client SDK.
GHSA-6cqj-6969-p57x CVE-2022-39199 MODERATE Lack of proper validation of server UUID can be used by the server to trick the client to accept invalid proofs

CVE-2022-36111 at a Glance

CVE Identifier CVE-2022-36111
GHSA Identifier GHSA-672p-m5jq-mrh8
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-345: Insufficient Verification of Data Authenticity
Affected Product Github.com/codenotary/immudb
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required High (PR:H)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2022-36111

To remediate this vulnerability, upgrade all affected Github.com/codenotary/immudb dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/codenotary/immudb fixed: 1.4.1
Upgrade github.com/codenotary/immudb to 1.4.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/codenotary/immudb

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-36111, inspect your project dependencies for Github.com/codenotary/immudb:

inspect dependencies for github.com/codenotary/immudb

Analyze the terminal output to locate any version of Github.com/codenotary/immudb in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.4.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-345: Insufficient Verification of Data Authenticity, where the product does not sufficiently verify the origin or authenticity of data, in a way that causes it to accept invalid data. In Github.com/codenotary/immudb, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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: * a client requests a verified write operation * the server responds with a proof for the transaction * client stores the state value retrieved from the server and expects it to be a confirmation of that write and all the history of the database before that transaction * a series of validated read / write operations is performed by the client, each accompanied by a successfully validated consistency proof and update of the client state * the client requests verified get operation on the transaction it has written before (and that was verified with a proof from the server) * the server replies with a completely different transaction that can be properly validated according to the currently stored db state on the client side ### Patches The following Go SDK versions is not vulnerable: | **SDK** | **Version** | |-------|------------| | [go](pkg.go.dev/github.com/codenotary/immudb/pkg/client) | 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 * https://github.com/codenotary/immudb/tree/master/docs/security/vulnerabilities/linear-fake ### For more information If you have any questions or comments about this advisory: * Open a discussion in [immudb Discussions](https://github.com/codenotary/immudb/discussions/new) * Email us at [immudb-security@codenotary.com](mailto:immudb-security@codenotary.com)

CVE-2022-36111 Affected Github.com/codenotary/immudb Versions

1 component(s)
Fixed Versions:
1.4.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/codenotary/immudb
Go
< 1.4.1
1.4.1

References

Frequently Asked Questions

What is CVE-2022-36111?
CVE-2022-36111 is a security vulnerability in Github.com/codenotary/immudb involving Insufficient Verification of Proofs generated by the immudb server in client SDK. under CWE-345: Insufficient Verification of Data Authenticity.
Which Github.com/codenotary/immudb versions are affected?
Affected versions include releases prior to 1.4.1 across affected packages: github.com/codenotary/immudb.
What version fixes CVE-2022-36111?
Upgrading to 1.4.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/codenotary/immudb affected?
Yes, github.com/codenotary/immudb is affected in releases prior to 1.4.1. Upgrade your dependency to 1.4.1 or later.
What is the CVSS score of CVE-2022-36111?
CVE-2022-36111 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:N/I:H/A:N.
What CWE is associated with CVE-2022-36111?
CVE-2022-36111 is classified under CWE-345: Insufficient Verification of Data Authenticity (The product does not sufficiently verify the origin or authenticity of data, in a way that causes it to accept invalid data.).
How can I check Go dependencies for CVE-2022-36111?
Run the dependency tree command: 'inspect dependencies for github.com/codenotary/immudb'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-672p-m5jq-mrh8",
  "modified" : "2024-05-20T21:34:49Z",
  "published" : "2022-11-21T20:38:39Z",
  "aliases" : [ "CVE-2022-36111" ],
  "summary" : "Insufficient Verification of Proofs generated by the immudb server in client SDK.",
  "details" : "### Impact\n\nIn 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.\n\nThis vulnerability only affects immudb client SDKs, the immudb server itself is not affected by this vulnerability.\n\n### Detailed description\n\nimmudb 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.\n\nThe 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.\n\nWhen 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.\n\nThis 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.\n\nIn practice this could lead to a following scenario:\n\n* a client requests a verified write operation\n* the server responds with a proof for the transaction\n* client stores the state value retrieved from the server and expects it to be a confirmation of that write and all the history of the database before that transaction\n* a series of validated read / write operations is performed by the client, each accompanied by a successfully validated consistency proof and update of the client state\n* the client requests verified get operation on the transaction it has written before (and that was verified with a proof from the server)\n* the server replies with a completely different transaction that can be properly validated according to the currently stored db state on the client side\n\n### Patches\n\nThe following Go SDK versions is not vulnerable:\n\n| **SDK** | **Version** |\n|-------|------------|\n| [go](pkg.go.dev/github.com/codenotary/immudb/pkg/client) | 1.4.1 |\n\n### Workarounds\n\nInvalid proofs can not be generated in a normal immudb server and will be detected by a genuine replica server.\nTo ensure that the server does not produce invalid proofs and to check that the history presented by the server\ndoes not contain falsified transactions, one should run a genuine immudb replica server in a safe environment\nand fully synchronize all databases with the primary.\n\n### References\n\n* https://github.com/codenotary/immudb/tree/master/docs/security/vulnerabilities/linear-fake\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n* Open a discussion in [immudb Discussions](https://github.com/codenotary/immudb/discussions/new)\n* Email us at [immudb-security@codenotary.com](mailto:immudb-security@codenotary.com)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/codenotary/immudb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.4.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/codenotary/immudb/security/advisories/GHSA-672p-m5jq-mrh8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-36111"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/codenotary/immudb/commit/7267d67e28be8f0257b71d734611a051593e8a81"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/codenotary/immudb/commit/acf7f1b3d62436ea5e038acea1fc6394f90ab1c6"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/codenotary/immudb"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/codenotary/immudb/releases/tag/v1.4.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/codenotary/immudb/tree/master/docs/security/vulnerabilities/linear-fake"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/github.com/codenotary/immudb/pkg/client"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2022-1117"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-345" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-11-21T20:38:39Z",
    "nvd_published_at" : "2022-11-23T18:15:00Z"
  }
}