# CVE-2021-22861: Improper access control in GitHub Enterprise Server leading to unauthorized write access to forkable repositories

- Severity: Medium 6.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.94%, higher than 61% of CVEs (2026-12-01)
- Published: 2021-03-03T03:25:21.000Z
- Modified: 2026-06-17T03:37:53.947Z
- Weaknesses: CWE-285
- Assigned by: GitHub_P

## Description

An improper access control vulnerability was identified in GitHub Enterprise Server that allowed authenticated users of the instance to gain write access to unauthorized repositories via specifically crafted pull requests and REST API requests. An attacker would need to be able to fork the targeted repository, a setting that is disabled by default for organization owned private repositories. Branch protections such as required pull request reviews or status checks would prevent unauthorized commits from being merged without further review or validation. This vulnerability affected all versions of GitHub Enterprise Server since 2.4.21 and was fixed in versions 2.20.24, 2.21.15, 2.22.7 and 3.0.1. This vulnerability was reported via the GitHub Bug Bounty program.

(As written by CVE List.)

## Affected

- GitHub GitHub Enterprise Server: from 2.20 before 2.20.24; from 2.21 before 2.21.15; from 2.22 before 2.22.7; from 3.0 before 3.0.1
- github github: from 2.4.21 before 2.20.24; from 2.21.0 before 2.21.15; from 2.22.0 before 2.22.7; from 3.0.0 before 3.0.1

## Every score

- NVD: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N`
- NVD: CVSS:2.0 4.0 Medium `AV:N/AC:L/Au:S/C:N/I:P/A:N`

## References

- <https://docs.github.com/en/enterprise-server%402.20/admin/release-notes#2.20.24>
- <https://docs.github.com/en/enterprise-server%402.21/admin/release-notes#2.21.15>
- <https://docs.github.com/en/enterprise-server%402.22/admin/release-notes#2.22.7>
- <https://docs.github.com/en/enterprise-server%403.0/admin/release-notes#3.0.1>

## Sources

- CVE List: [CVE-2021-22861](https://www.cve.org/CVERecord?id=CVE-2021-22861), CVE Terms of Use, modified 2024-08-03
- NVD: [CVE-2021-22861](https://nvd.nist.gov/vuln/detail/CVE-2021-22861), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-22861 · Whole record: https://cve.day/CVE-2021-22861.json · Rebuilt by cve.day 2026-11-25T22:58:00.120Z
