Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2022-31072: CWE-276: Incorrect Default Permissions in octokit octokit.rb

0
Medium
Published: Wed Jun 15 2022 (06/15/2022, 22:35:10 UTC)
Source: CVE
Vendor/Project: octokit
Product: octokit.rb

Description

Octokit is a Ruby toolkit for the GitHub API. Versions 4.23.0 and 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. This issue is patched in Octokit 4.25.0. Two workarounds are available. Users can use the previous version of the gem, v4.22.0. Alternatively, users can modify the file permissions manually until they are able to upgrade to the latest version.

AI-Powered Analysis

AILast updated: 06/23/2025, 04:50:26 UTC

Technical Analysis

CVE-2022-31072 is a security vulnerability identified in the octokit.rb Ruby gem, a widely used toolkit for interacting with the GitHub API. Specifically, versions 4.23.0 and 4.24.0 of the octokit gem were released with an incorrect default file permission setting. Files within these versions were packaged with world-writable permissions (0666 or -rw-rw-rw-), rather than the more restrictive and secure permissions (0644 or rw-r--r--). This misconfiguration means that any user or process on the same system, other than the file owner, can modify these files. Such unauthorized modifications could lead to code tampering, insertion of malicious code, or other integrity violations within applications relying on this gem. The vulnerability is classified under CWE-276 (Incorrect Default Permissions), highlighting the risk of overly permissive access controls. The issue was addressed and patched in version 4.25.0 of octokit.rb. Until users upgrade, two workarounds exist: reverting to version 4.22.0, which does not have this issue, or manually correcting the file permissions to remove world-writable access. No known exploits have been reported in the wild to date. The vulnerability primarily affects environments where the gem is installed and accessible by multiple users or processes, such as shared servers or multi-tenant systems. Since octokit.rb is a developer tool for GitHub API integration, it is commonly used in development, CI/CD pipelines, and automation scripts, making the integrity of its files critical for secure operations.

Potential Impact

For European organizations, the impact of this vulnerability can be significant, especially for those relying on Ruby-based development environments and automation tools that integrate with GitHub. Unauthorized modification of the gem's files could lead to injection of malicious code, potentially compromising the confidentiality and integrity of source code repositories, build processes, or deployment pipelines. This could result in supply chain attacks, unauthorized access to sensitive data, or disruption of software delivery. Organizations operating in shared hosting environments or with multiple users on the same systems are at higher risk, as any user with access could exploit the world-writable files. The vulnerability does not directly affect availability but could indirectly cause service disruptions if malicious modifications lead to failures or security incidents. Given the widespread use of GitHub and associated tooling in European tech sectors, including finance, manufacturing, and government, the risk extends to critical infrastructure and sensitive projects. However, the lack of known exploits and the availability of patches reduce the immediate threat level. The vulnerability's impact is also mitigated if systems enforce strict user access controls and do not allow untrusted users on the same host.

Mitigation Recommendations

European organizations should prioritize upgrading octokit.rb to version 4.25.0 or later to fully remediate the vulnerability. Until upgrades can be performed, organizations should manually audit and correct file permissions of the gem files to remove world-writable access (e.g., setting permissions to 0644). It is recommended to automate permission checks as part of deployment or CI/CD pipelines to detect and prevent reintroduction of insecure permissions. Additionally, organizations should review user access controls on systems where octokit.rb is installed to ensure that only trusted users have access, minimizing the risk of unauthorized modifications. Employing file integrity monitoring tools can help detect unauthorized changes to gem files. For environments using containerization or virtual machines, rebuilding images with the patched gem version and secure permissions is advised. Finally, organizations should educate developers and DevOps teams about the risks of incorrect file permissions and encourage best practices in dependency management and security patching.

Need more detailed analysis?Upgrade to Pro Console

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2022-05-18T00:00:00.000Z
Cisa Enriched
true

Threat ID: 682d9844c4522896dcbf34af

Added to database: 5/21/2025, 9:09:24 AM

Last enriched: 6/23/2025, 4:50:26 AM

Last updated: 2/7/2026, 5:09:34 AM

Views: 39

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats