CVE-2022-31072: CWE-276: Incorrect Default Permissions in octokit octokit.rb
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 Analysis
Technical Summary
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.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Ireland, Belgium
CVE-2022-31072: CWE-276: Incorrect Default Permissions in octokit 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
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.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
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: 8/18/2025, 11:32:15 PM
Views: 18
Related Threats
CVE-2025-9341: CWE-400 Uncontrolled Resource Consumption in Legion of the Bouncy Castle Inc. Bouncy Castle for Java FIPS
MediumCVE-2025-8678: CWE-918 Server-Side Request Forgery (SSRF) in johnbillion WP Crontrol
MediumCVE-2025-57699: Unquoted search path or element in Western Digital Corporation Western Digital Kitfox for Windows
MediumCVE-2025-8281: CWE-79 Cross-Site Scripting (XSS) in WP Talroo
HighCVE-2025-41452: CWE-15: External Control of System or Configuration Setting in Danfoss AK-SM8xxA Series
MediumActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.