Skip to main content

CVE-2022-1986 — OS Command Injection in gogs.io/gogs — CVE Details

CRITICAL

OS Command Injection in file editor in Gogs

Published June 8, 2022Updated August 21, 2024Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (4.75%). Schedule for your next planned update.

Does your project use an affected gogs.io/gogs version?

Paste your go.sum to check it for CVE-2022-1986 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my go.sum

Summary

Impact

The malicious user is able to update a crafted config file into repository's .git directory in combination with crafted file deletion to gain SSH access to the server. All installations with repository upload enabled (default) are affected.

Patches

File deletions are prohibited to repository's .git directory. Users should upgrade to 0.12.9 or the latest 0.13.0+dev.

Workarounds

N/A

References

https://huntr.dev/bounties/776e8f29-ff5e-4501-bb9f-0bd335007930/

For more information

If you have any questions or comments about this advisory, please post on #7000.

Advisory Timeline

  • First published June 8, 2022 (1632 days ago).
  • Last revised August 21, 2024 — 805 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Go
Update gogs.io/gogs to 0.12.9 or later
go get gogs.io/gogs@v0.12.9

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: Go (1).

PackageFixed In
gogs.io/gogs Go · Affected: All versions0.12.9

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-78
    OS Command InjectionMITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Frequently Asked Questions

What is CVE-2022-1986?
OS Command Injection in file editor in Gogs. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.8/10).
How do I check if my project is affected by CVE-2022-1986?
CVE-2022-1986 affects gogs.io/gogs. It has a 4.8% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2022-1986 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.8

Maximum impact if exploited, often with little effort or access required.

EPSS Score (30-day exploit probability)
4.75%
EPSS percentile: 92.6

This places it in the top 10% of EPSS-scored vulnerabilities — 92.6% of tracked vulnerabilities score at or below it, so it is substantially more likely to be exploited than most tracked vulnerabilities.

Also Known As

GHSA-67mx-jc2f-jgjm
GO-2022-0556

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my go.sum