{"id":"CVE-2022-0415","aliases":["EUVD-2022-1322","GHSA-5gjh-5j4f-cpwv","GO-2022-0554","UBUNTU-CVE-2022-0415"],"status":"published","title":"Remote Command Execution in uploading repository file in gogs/gogs","description":"Remote Command Execution in uploading repository file in GitHub repository gogs/gogs prior to 0.12.6.","severity":{"version":"3.0","score":9.9,"vector":"CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"critical","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.65935,"percentile":0.99277,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-20","CWE-434"],"published":"2022-03-21T10:45:13Z","modified":"2026-10-28T02:30:34Z","exploits":[{"source":"nuclei","id":"CVE-2022-0415","title":"Gogs \u003c0.12.6 - Remote Command Execution","type":"detection template","url":"https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2022/CVE-2022-0415.yaml"}],"fixes":[{"ecosystem":"Go","package":"gogs.io/gogs","fixed_in":["0.12.6"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"Go","package":"gogs.io/gogs","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.12.6"}]}]},{"source":"osv","ecosystem":"Go","package":"gogs.io/gogs","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.12.6"}]}]},{"source":"osv","ecosystem":"Go","package":"gogs.io/gogs","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.12.6"}]}]},{"source":"osv","ecosystem":"Ubuntu:20.04:LTS","package":"golang-github-gogits-go-gogs-client","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0~git20160830.0.d8aff57-2"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"golang-github-gogits-go-gogs-client","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0~git20160830.0.d8aff57-2"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"golang-github-gogits-go-gogs-client","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0~git20160830.0.d8aff57-2"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"golang-github-gogits-go-gogs-client","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0~git20160830.0.d8aff57-2"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"golang-github-gogits-go-gogs-client","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0~git20210131.1d7215c-1"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"golang-github-gogits-go-gogs-client","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0~git20160830.0.d8aff57-2","0.0~git20210131.1d7215c-1"]}],"products":[{"vendor":"gogs","product":"gogs"},{"vendor":"gogs","product":"gogs/gogs"}],"references":[{"url":"https://huntr.dev/bounties/b4928cfe-4110-462f-a180-6d5673797902","tags":["x_refsource_CONFIRM","x_transferred","Exploit","Patch","Third Party Advisory","web","report"]},{"url":"https://github.com/gogs/gogs/commit/0fef3c9082269e9a4e817274942a5d7c50617284","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web","report"]},{"url":"https://github.com/gogs/gogs/security/advisories/GHSA-5gjh-5j4f-cpwv","tags":["web","advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-0415","tags":["advisory"]},{"url":"https://github.com/gogs/gogs/issues/6833","tags":["web"]},{"url":"https://github.com/gogs/gogs/pull/6838","tags":["web"]},{"url":"https://github.com/advisories/GHSA-5gjh-5j4f-cpwv"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/0xxx/CVE-2022-0415.json","tags":["advisory"]},{"url":"https://github.com/gogs/gogs","tags":["package"]},{"url":"https://ubuntu.com/security/CVE-2022-0415","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2022-0415","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2022-0415","title":"Remote Command Execution in uploading repository file in gogs/gogs","description":"Remote Command Execution in uploading repository file in GitHub repository gogs/gogs prior to 0.12.6.","status":"published","published":"2022-03-21T10:45:13Z","modified":"2024-08-02T23:25:40.311Z","cvss":[{"version":"3.0","score":9.9,"vector":"CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"critical","assessor":"cna"}],"cwes":["CWE-20"],"updated_at":"2026-11-02T14:34:41.34666Z"}],"euvd":[{"id":"EUVD-2022-1322","description":"Remote Command Execution in uploading repository file in GitHub repository gogs/gogs prior to 0.12.6.","status":"published","published":"2022-03-21T10:45:13Z","modified":"2024-08-02T23:25:40Z","cvss":[{"version":"3.0","score":9.9,"vector":"CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-03T03:26:05.607314Z"}],"ghsa":[{"id":"GHSA-5gjh-5j4f-cpwv","title":"Unrestricted Upload of File with Dangerous Type in Gogs","description":"### Impact\n\nThe malicious user is able to upload a crafted `config` file into repository's `.git` directory with to gain SSH access to the server. All installations with [repository upload enabled (default)](https://github.com/gogs/gogs/blob/f36eeedbf89328ee70cc3a2e239f6314f9021f58/conf/app.ini#L127-L129) are affected.\n\n### Patches\n\nRepository file uploads are prohibited to its `.git` directory. Users should upgrade to 0.12.6 or the latest 0.13.0+dev.\n\n### Workarounds\n\n[Disable repository files upload](https://github.com/gogs/gogs/blob/f36eeedbf89328ee70cc3a2e239f6314f9021f58/conf/app.ini#L128-L129).\n\n### References\n\nhttps://huntr.dev/bounties/b4928cfe-4110-462f-a180-6d5673797902/\n\n### For more information\n\nIf you have any questions or comments about this advisory, please post on #6833.\n","status":"published","published":"2022-03-28T16:46:41Z","modified":"2023-01-27T05:01:06Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-20","CWE-434"],"updated_at":"2026-11-02T14:36:16.28305Z"}],"nvd":[{"id":"CVE-2022-0415","description":"Remote Command Execution in uploading repository file in GitHub repository gogs/gogs prior to 0.12.6.","status":"published","published":"2022-03-21T11:15:10.757Z","modified":"2026-06-17T04:20:33.71Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high","assessor":"primary"},{"version":"3.0","score":9.9,"vector":"CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"critical","assessor":"secondary"},{"version":"2.0","score":6.5,"vector":"AV:N/AC:L/Au:S/C:P/I:P/A:P","level":"medium","assessor":"primary"}],"cwes":["CWE-20","CWE-434"],"updated_at":"2026-11-02T14:07:14.24948Z"}],"osv":[{"id":"CVE-2022-0415","title":"Remote Command Execution in uploading repository file in gogs/gogs","description":"Remote Command Execution in uploading repository file in GitHub repository gogs/gogs prior to 0.12.6.","status":"published","published":"2022-03-21T10:45:13Z","modified":"2026-10-28T02:30:34.958267751Z","cvss":[{"version":"3.0","score":9.9,"vector":"CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-20"],"updated_at":"2026-11-02T15:44:22.824781Z"},{"id":"GHSA-5gjh-5j4f-cpwv","title":"Unrestricted Upload of File with Dangerous Type in Gogs","description":"### Impact\n\nThe malicious user is able to upload a crafted `config` file into repository's `.git` directory with to gain SSH access to the server. All installations with [repository upload enabled (default)](https://github.com/gogs/gogs/blob/f36eeedbf89328ee70cc3a2e239f6314f9021f58/conf/app.ini#L127-L129) are affected.\n\n### Patches\n\nRepository file uploads are prohibited to its `.git` directory. Users should upgrade to 0.12.6 or the latest 0.13.0+dev.\n\n### Workarounds\n\n[Disable repository files upload](https://github.com/gogs/gogs/blob/f36eeedbf89328ee70cc3a2e239f6314f9021f58/conf/app.ini#L128-L129).\n\n### References\n\nhttps://huntr.dev/bounties/b4928cfe-4110-462f-a180-6d5673797902/\n\n### For more information\n\nIf you have any questions or comments about this advisory, please post on #6833.\n","status":"published","published":"2022-03-28T16:46:41Z","modified":"2024-08-21T15:26:55.091749Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-20","CWE-434"],"updated_at":"2026-11-02T15:46:38.213481Z"},{"id":"UBUNTU-CVE-2022-0415","description":"Remote Command Execution in uploading repository file in GitHub repository gogs/gogs prior to 0.12.6.","status":"published","published":"2022-03-21T11:15:00Z","modified":"2026-10-17T12:56:16.264213589Z","cvss":[{"version":"3.0","score":9.9,"vector":"CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"critical"},{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T16:53:51.630172Z"},{"id":"GO-2022-0554","title":"Unrestricted Upload of File with Dangerous Type in Gogs in gogs.io/gogs","description":"Unrestricted Upload of File with Dangerous Type in Gogs in gogs.io/gogs","status":"published","published":"2024-08-21T15:11:36Z","modified":"2026-03-03T04:50:31.965024Z","updated_at":"2026-11-02T15:47:00.918515Z"}]}}
