CVE-2022-31026: Trilogy Use Of Uninitialized Variable Vulnerability

MODERATE
Advisory Identifier: GHSA-5g4r-2qhx-vqfm
CVSS 5.9
CWE-908
Published
Advisory Summary

CVE-2022-31026 is a MODERATE (CVSS 5.9) use of uninitialized variable vulnerability (CWE-908: Use of Uninitialized Resource) affecting Trilogy libraries in the RubyGems ecosystem. The issue involves use of uninitialized variable in trilogy. Remediation is available by upgrading affected packages to version 2.1.1.

CVE-2022-31026 at a Glance

CVE Identifier CVE-2022-31026
GHSA Identifier GHSA-5g4r-2qhx-vqfm
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-908: Use of Uninitialized Resource
Affected Product Trilogy
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 5.9

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

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

How to Fix CVE-2022-31026

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

trilogy fixed: 2.1.1
Upgrade trilogy to 2.1.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 trilogy

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-31026, inspect your project dependencies for Trilogy:

inspect dependencies for trilogy

Analyze the terminal output to locate any version of Trilogy in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.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-908: Use of Uninitialized Resource, where the product uses or accesses a resource that has not been initialized. In Trilogy, 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 When authenticating, a malicious server could return a specially crafted authentication packet, causing the client to read and return up to 12 bytes of data from an uninitialized variable in stack memory. ### Patches Users of the trilogy gem should upgrade to version 2.1.1 ### Workarounds This issue can be avoided by only connecting to trusted servers. ### Acknowledgements We would like to thank Sergei Volokitin for reporting this vulnerability ### For more information If you have any questions or comments about this advisory: * Open an issue in [trilogy](https://github.com/github/trilogy)

CVE-2022-31026 Affected Trilogy Versions

1 component(s)
Fixed Versions:
2.1.1
Product / Package Ecosystem Affected Versions Fixed Version
trilogy
RubyGems
< 2.1.1
2.1.1

References

Frequently Asked Questions

What is CVE-2022-31026?
CVE-2022-31026 is a security vulnerability in Trilogy involving Use of Uninitialized Variable in trilogy under CWE-908: Use of Uninitialized Resource.
Which Trilogy versions are affected?
Affected versions include releases prior to 2.1.1 across affected packages: trilogy.
What version fixes CVE-2022-31026?
Upgrading to 2.1.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is trilogy affected?
Yes, trilogy is affected in releases prior to 2.1.1. Upgrade your dependency to 2.1.1 or later.
What is the CVSS score of CVE-2022-31026?
CVE-2022-31026 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2022-31026?
CVE-2022-31026 is classified under CWE-908: Use of Uninitialized Resource (The product uses or accesses a resource that has not been initialized.).
How can I check RubyGems dependencies for CVE-2022-31026?
Run the dependency tree command: 'inspect dependencies for trilogy'. 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-5g4r-2qhx-vqfm",
  "modified" : "2022-06-06T21:22:05Z",
  "published" : "2022-06-06T21:22:05Z",
  "aliases" : [ "CVE-2022-31026" ],
  "summary" : "Use of Uninitialized Variable in trilogy",
  "details" : "### Impact\n\nWhen authenticating, a malicious server could return a specially crafted authentication packet, causing the client to read and return up to 12 bytes of data from an uninitialized variable in stack memory.\n\n### Patches\n\nUsers of the trilogy gem should upgrade to version 2.1.1\n\n### Workarounds\n\nThis issue can be avoided by only connecting to trusted servers.\n\n### Acknowledgements \n\nWe would like to thank Sergei Volokitin for reporting this vulnerability\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [trilogy](https://github.com/github/trilogy)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "trilogy"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.1.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/github/trilogy/security/advisories/GHSA-5g4r-2qhx-vqfm"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-31026"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/github/trilogy/commit/6bed62789eaf119902b0fe247d2a91d56c31a962"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/github/trilogy"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/trilogy/CVE-2022-31026.yml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-908" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-06T21:22:05Z",
    "nvd_published_at" : "2022-06-09T13:15:00Z"
  }
}