CVE-2020-14144: Code.gitea.io/gitea Arbitrary Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-3h6c-c475-jm7v
CVSS 7.2
CWE-78
Published
Advisory Summary

CVE-2020-14144 is a HIGH (CVSS 7.2) arbitrary code execution vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Code.gitea.io/gitea libraries in the Go ecosystem. The issue involves arbitrary code execution in gitea. Remediation is available by upgrading affected packages to version 1.12.6.

CVE-2020-14144 at a Glance

CVE Identifier CVE-2020-14144
GHSA Identifier GHSA-3h6c-c475-jm7v
Severity HIGH
CVSS v3.1 Base Score 7.2
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Code.gitea.io/gitea
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.2

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

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

How to Fix CVE-2020-14144

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

code.gitea.io/gitea fixed: 1.12.6
Upgrade code.gitea.io/gitea to 1.12.6
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 code.gitea.io/gitea

How to Check if You Are Affected

To determine whether your application is affected by CVE-2020-14144, inspect your project dependencies for Code.gitea.io/gitea:

inspect dependencies for code.gitea.io/gitea

Analyze the terminal output to locate any version of Code.gitea.io/gitea in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.12.6), 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-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Code.gitea.io/gitea, 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

The git hook feature in Gitea 1.1.0 through 1.12.5 allows for authenticated remote code execution.

CVE-2020-14144 Affected Code.gitea.io/gitea Versions

1 component(s)
Fixed Versions:
1.12.6
Product / Package Ecosystem Affected Versions Fixed Version
code.gitea.io/gitea
Go
≥ 1.1.0
< 1.12.6
1.12.6

References

NVD — CVE-2020-14144 NVD
https://nvd.nist.gov/vuln/detail/CVE-2020-14144
Code.gitea.io/gitea Source Repository REPOSITORY
https://github.com/go-gitea/gitea/pull/13058
Security Fix Commit FIX COMMIT
https://github.com/go-gitea/gitea/commit/8fe8ab5cbf2977f3a01ea12361df2cd76dce3ea9
Code.gitea.io/gitea Source Repository REPOSITORY
https://docs.github.com/en/enterprise-server%402.19/admin/policies/creating-a-pre-receive-hook-script
Code.gitea.io/gitea Source Repository REPOSITORY
https://docs.github.com/en/enterprise-server@2.19/admin/policies/creating-a-pre-receive-hook-script
docs.gitlab.com/ee/administration/s... WEB
https://docs.gitlab.com/ee/administration/server_hooks.html
Code.gitea.io/gitea Source Repository REPOSITORY
https://github.com/PandatiX/CVE-2021-28378
Code.gitea.io/gitea Source Repository REPOSITORY
https://github.com/PandatiX/CVE-2021-28378#notes
Code.gitea.io/gitea Source Repository REPOSITORY
https://github.com/go-gitea/gitea
Code.gitea.io/gitea Source Repository REPOSITORY
https://github.com/go-gitea/gitea/releases
podalirius.net/articles/exploiting... WEB
https://podalirius.net/articles/exploiting-cve-2020-14144-gitea-authenticated-remote-code-execution
www.exploit-db.com/exploits/49571 WEB
https://www.exploit-db.com/exploits/49571
www.fzi.de/en/news/news/detail... WEB
https://www.fzi.de/en/news/news/detail-en/artikel/fsa-2020-3-schwachstelle-in-gitea-1125-und-gogs-0122-ermoeglicht-ausfuehrung-von-code-nach-authent
Code.gitea.io/gitea Security Information SECURITY
http://packetstormsecurity.com/files/162122/Gitea-Git-Hooks-Remote-Code-Execution.html

Frequently Asked Questions

What is CVE-2020-14144?
CVE-2020-14144 is a security vulnerability in Code.gitea.io/gitea involving Arbitrary Code Execution in Gitea under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Code.gitea.io/gitea versions are affected?
Affected versions include releases prior to 1.12.6 across affected packages: code.gitea.io/gitea.
What version fixes CVE-2020-14144?
Upgrading to 1.12.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is code.gitea.io/gitea affected?
Yes, code.gitea.io/gitea is affected in releases prior to 1.12.6. Upgrade your dependency to 1.12.6 or later.
What is the CVSS score of CVE-2020-14144?
CVE-2020-14144 has a CVSS v3.1 base score of 7.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2020-14144?
CVE-2020-14144 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check Go dependencies for CVE-2020-14144?
Run the dependency tree command: 'inspect dependencies for code.gitea.io/gitea'. 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-3h6c-c475-jm7v",
  "modified" : "2024-04-22T19:07:03Z",
  "published" : "2024-04-22T19:07:03Z",
  "aliases" : [ "CVE-2020-14144" ],
  "summary" : "Arbitrary Code Execution in Gitea",
  "details" : "The git hook feature in Gitea 1.1.0 through 1.12.5 allows for authenticated remote code execution.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "code.gitea.io/gitea"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.1.0"
      }, {
        "fixed" : "1.12.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-14144"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-gitea/gitea/pull/13058"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-gitea/gitea/commit/8fe8ab5cbf2977f3a01ea12361df2cd76dce3ea9"
  }, {
    "type" : "WEB",
    "url" : "https://docs.github.com/en/enterprise-server%402.19/admin/policies/creating-a-pre-receive-hook-script"
  }, {
    "type" : "WEB",
    "url" : "https://docs.github.com/en/enterprise-server@2.19/admin/policies/creating-a-pre-receive-hook-script"
  }, {
    "type" : "WEB",
    "url" : "https://docs.gitlab.com/ee/administration/server_hooks.html"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/PandatiX/CVE-2021-28378"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/PandatiX/CVE-2021-28378#notes"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/go-gitea/gitea"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-gitea/gitea/releases"
  }, {
    "type" : "WEB",
    "url" : "https://podalirius.net/articles/exploiting-cve-2020-14144-gitea-authenticated-remote-code-execution"
  }, {
    "type" : "WEB",
    "url" : "https://www.exploit-db.com/exploits/49571"
  }, {
    "type" : "WEB",
    "url" : "https://www.fzi.de/en/news/news/detail-en/artikel/fsa-2020-3-schwachstelle-in-gitea-1125-und-gogs-0122-ermoeglicht-ausfuehrung-von-code-nach-authent"
  }, {
    "type" : "WEB",
    "url" : "http://packetstormsecurity.com/files/162122/Gitea-Git-Hooks-Remote-Code-Execution.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-22T19:07:03Z",
    "nvd_published_at" : "2020-10-16T14:15:11Z"
  }
}