Vulnerabilities in pkg:gem/octokit

PACKAGE
Advisory Identifier: GHSA-g28x-pgr3-qqx6
Advisory Summary

CVE-2022-31072 is a LOW (CVSS 2.5) octokit gem published with world-writable vulnerability (CWE-276: Incorrect Default Permissions) affecting Octokit libraries in the RubyGems ecosystem. The issue involves octokit gem published with world-writable files. Remediation is available by upgrading affected packages to version 4.25.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:gem/octokit

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:gem/octokit. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-g28x-pgr3-qqx6 CVE-2022-31072 LOW Octokit gem published with world-writable files

CVE-2022-31072 at a Glance

CVE Identifier CVE-2022-31072
GHSA Identifier GHSA-g28x-pgr3-qqx6
Severity LOW
CVSS v3.1 Base Score 2.5
CWE Classification CWE-276: Incorrect Default Permissions
Affected Product Octokit
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 2.5

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

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

How to Fix CVE-2022-31072

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

octokit fixed: 4.25.0
Upgrade octokit to 4.25.0
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 octokit

How to Check if You Are Affected

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

inspect dependencies for octokit

Analyze the terminal output to locate any version of Octokit in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.25.0), 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-276: Incorrect Default Permissions, where during installation, installed file permissions are set to allow anyone to modify those files. In Octokit, 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 Versions [4.23.0](https://rubygems.org/gems/octokit/versions/4.23.0) and [4.24.0](https://rubygems.org/gems/octokit/versions/4.24.0) of the octokit gem were published containing world-writeable files. Specifically, the gem was packed with files having their permissions set to `-rw-rw-rw-` (i.e. 0666) instead of `rw-r--r--` (i.e. 0644). This means everyone who is not the owner (Group and Public) with access to the instance where this release had been installed could modify the world-writable files from this gem. Malicious code already present and running on your machine, separate from this package, could modify the gem’s files and change its behavior during runtime. ### Patches * [octokit 4.25.0](https://rubygems.org/gems/octokit/versions/4.25.0) ### Workarounds Users can use the previous version of the gem [v4.22.0](https://rubygems.org/gems/octokit/versions/4.22.0). Alternatively, users can modify the file permissions manually until they are able to upgrade to the latest version.

CVE-2022-31072 Affected Octokit Versions

1 component(s)
Fixed Versions:
4.25.0
Product / Package Ecosystem Affected Versions Fixed Version
octokit
RubyGems
≥ 4.23.0
< 4.25.0
4.25.0

References

Frequently Asked Questions

What is CVE-2022-31072?
CVE-2022-31072 is a security vulnerability in Octokit involving Octokit gem published with world-writable files under CWE-276: Incorrect Default Permissions.
Which Octokit versions are affected?
Affected versions include releases prior to 4.25.0 across affected packages: octokit.
What version fixes CVE-2022-31072?
Upgrading to 4.25.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is octokit affected?
Yes, octokit is affected in releases prior to 4.25.0. Upgrade your dependency to 4.25.0 or later.
What is the CVSS score of CVE-2022-31072?
CVE-2022-31072 has a CVSS v3.1 base score of 2.5 (LOW) with vector string CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2022-31072?
CVE-2022-31072 is classified under CWE-276: Incorrect Default Permissions (During installation, installed file permissions are set to allow anyone to modify those files.).
How can I check RubyGems dependencies for CVE-2022-31072?
Run the dependency tree command: 'inspect dependencies for octokit'. 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-g28x-pgr3-qqx6",
  "modified" : "2022-07-13T19:19:18Z",
  "published" : "2022-06-15T21:24:16Z",
  "aliases" : [ "CVE-2022-31072" ],
  "summary" : "Octokit gem published with world-writable files",
  "details" : "### Impact\n\nVersions [4.23.0](https://rubygems.org/gems/octokit/versions/4.23.0) and [4.24.0](https://rubygems.org/gems/octokit/versions/4.24.0) of the octokit gem were published containing world-writeable files. \n\nSpecifically, the gem was packed with files having their permissions set to `-rw-rw-rw-` (i.e. 0666) instead of `rw-r--r--` (i.e. 0644). This means everyone who is not the owner (Group and Public) with access to the instance where this release had been installed could modify the world-writable files from this gem. \n\nMalicious code already present and running on your machine, separate from this package, could modify the gem’s files and change its behavior during runtime.\n\n### Patches\n* [octokit 4.25.0](https://rubygems.org/gems/octokit/versions/4.25.0)\n\n### Workarounds\nUsers can use the previous version of the gem [v4.22.0](https://rubygems.org/gems/octokit/versions/4.22.0). Alternatively, users can modify the file permissions manually until they are able to upgrade to the latest version.\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "octokit"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.23.0"
      }, {
        "fixed" : "4.25.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/octokit/octokit.rb/security/advisories/GHSA-g28x-pgr3-qqx6"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-31072"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/octokit/octokit.rb/commit/1c8edecc9cf23d1ceb959d91a416a69f55ce7d55"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/octokit/octokit.rb"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/octokit/CVE-2022-31072.yml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-276" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-15T21:24:16Z",
    "nvd_published_at" : "2022-06-15T23:15:00Z"
  }
}