CWE-863
Allowed-with-ReviewIncorrect Authorization
Abstraction: Class · Status: Incomplete
The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.
5659 vulnerabilities reference this CWE, most recent first.
GHSA-28MP-CX45-6MWQ
Vulnerability from github – Published: 2022-03-08 00:00 – Updated: 2022-03-17 00:03The [field] shortcode included with the Custom Content Shortcode WordPress plugin before 4.0.1, allows authenticated users with a role as low as contributor, to access arbitrary post metadata. This could lead to sensitive data disclosure, for example when used in combination with WooCommerce, the email address of orders can be retrieved
{
"affected": [],
"aliases": [
"CVE-2021-24824"
],
"database_specific": {
"cwe_ids": [
"CWE-284",
"CWE-863"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-03-07T09:15:00Z",
"severity": "MODERATE"
},
"details": "The [field] shortcode included with the Custom Content Shortcode WordPress plugin before 4.0.1, allows authenticated users with a role as low as contributor, to access arbitrary post metadata. This could lead to sensitive data disclosure, for example when used in combination with WooCommerce, the email address of orders can be retrieved",
"id": "GHSA-28mp-cx45-6mwq",
"modified": "2022-03-17T00:03:06Z",
"published": "2022-03-08T00:00:31Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-24824"
},
{
"type": "WEB",
"url": "https://wpscan.com/vulnerability/7b4d4675-6089-4435-9b56-31496adc4767"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-2935-F8MX-XC5W
Vulnerability from github – Published: 2022-05-24 19:07 – Updated: 2022-10-27 12:00A vulnerability in the deleteCustomType function of the WP Upload Restriction WordPress plugin allows low-level authenticated users to delete custom extensions added by administrators. This issue affects versions 2.2.3 and prior.
{
"affected": [],
"aliases": [
"CVE-2021-34626"
],
"database_specific": {
"cwe_ids": [
"CWE-863"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-07-07T13:15:00Z",
"severity": "MODERATE"
},
"details": "A vulnerability in the deleteCustomType function of the WP Upload Restriction WordPress plugin allows low-level authenticated users to delete custom extensions added by administrators. This issue affects versions 2.2.3 and prior.",
"id": "GHSA-2935-f8mx-xc5w",
"modified": "2022-10-27T12:00:26Z",
"published": "2022-05-24T19:07:06Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-34626"
},
{
"type": "WEB",
"url": "https://www.wordfence.com/vulnerability-advisories/#CVE-2021-34626"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-297F-R9W7-W492
Vulnerability from github – Published: 2022-10-20 19:00 – Updated: 2024-04-23 17:24Adobe Commerce versions 2.4.3-p2 (and earlier), 2.3.7-p3 (and earlier) and 2.4.4 (and earlier) are affected by an improper input validation vulnerability. An authenticated attacker can trigger an insecure direct object reference in the V1/customers/me endpoint to achieve information exposure and privilege escalation.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "magento/community-edition"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.3.7-p4"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Packagist",
"name": "magento/community-edition"
},
"ranges": [
{
"events": [
{
"introduced": "2.4.0"
},
{
"fixed": "2.4.3-p3"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Packagist",
"name": "magento/community-edition"
},
"ranges": [
{
"events": [
{
"introduced": "2.4.4"
},
{
"fixed": "2.4.5"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"2.4.4"
]
}
],
"aliases": [
"CVE-2022-42344"
],
"database_specific": {
"cwe_ids": [
"CWE-20",
"CWE-639",
"CWE-863"
],
"github_reviewed": true,
"github_reviewed_at": "2024-04-23T17:24:33Z",
"nvd_published_at": "2022-10-20T17:15:00Z",
"severity": "HIGH"
},
"details": "Adobe Commerce versions 2.4.3-p2 (and earlier), 2.3.7-p3 (and earlier) and 2.4.4 (and earlier) are affected by an improper input validation vulnerability. An authenticated attacker can trigger an insecure direct object reference in the `V1/customers/me` endpoint to achieve information exposure and privilege escalation.",
"id": "GHSA-297f-r9w7-w492",
"modified": "2024-04-23T17:24:33Z",
"published": "2022-10-20T19:00:29Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-42344"
},
{
"type": "PACKAGE",
"url": "https://github.com/magento/magento2"
},
{
"type": "WEB",
"url": "https://helpx.adobe.com/security/products/magento/apsb22-38.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Magento Improper input validation vulnerability"
}
GHSA-299Q-3P96-5898
Vulnerability from github – Published: 2024-05-07 15:30 – Updated: 2024-05-08 14:01An authenticated user could potentially access metadata for a datasource they are not authorized to view by submitting a targeted REST API request. This issue affects Apache Superset before 3.1.2.
Users are recommended to upgrade to version 3.1.2 or above, which fixes the issue.
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "apache-superset"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.1.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-28148"
],
"database_specific": {
"cwe_ids": [
"CWE-863"
],
"github_reviewed": true,
"github_reviewed_at": "2024-05-07T16:53:40Z",
"nvd_published_at": "2024-05-07T14:15:10Z",
"severity": "MODERATE"
},
"details": "An authenticated user could potentially access metadata for a datasource they are not authorized to view by submitting a targeted REST API request. This issue affects Apache Superset before 3.1.2.\n\nUsers are recommended to upgrade to version 3.1.2 or above, which fixes the issue.\n\n",
"id": "GHSA-299q-3p96-5898",
"modified": "2024-05-08T14:01:40Z",
"published": "2024-05-07T15:30:36Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-28148"
},
{
"type": "PACKAGE",
"url": "https://github.com/apache/superset"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread/n27wlbd05oc6bgjh28d5pxzsrrph8dgo"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "Apache Superset Incorrect Authorization vulnerability"
}
GHSA-29G7-9VCG-G9RM
Vulnerability from github – Published: 2023-11-20 09:30 – Updated: 2024-10-02 06:30Wago web-based management of multiple products has a vulnerability which allows an local authenticated attacker to change the passwords of other non-admin users and thus to escalate non-root privileges.
{
"affected": [],
"aliases": [
"CVE-2023-3379"
],
"database_specific": {
"cwe_ids": [
"CWE-269",
"CWE-863"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-11-20T08:15:44Z",
"severity": "MODERATE"
},
"details": "Wago web-based management of multiple products has a vulnerability which allows an local authenticated attacker to change the passwords of other non-admin users and thus to escalate non-root privileges.",
"id": "GHSA-29g7-9vcg-g9rm",
"modified": "2024-10-02T06:30:26Z",
"published": "2023-11-20T09:30:30Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-3379"
},
{
"type": "WEB",
"url": "https://cert.vde.com/en/advisories/VDE-2023-015"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L",
"type": "CVSS_V3"
}
]
}
GHSA-29H6-3FPG-R7JH
Vulnerability from github – Published: 2022-05-24 19:14 – Updated: 2022-07-13 00:00Improper Access Control in Jfinal CMS v4.7.1 and earlier allows remote attackers to obtain sensitive information via the 'FileManager.editFile()' function in the component 'modules/filemanager/FileManagerController.java'.
{
"affected": [],
"aliases": [
"CVE-2020-19154"
],
"database_specific": {
"cwe_ids": [
"CWE-863"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-09-15T14:15:00Z",
"severity": "MODERATE"
},
"details": "Improper Access Control in Jfinal CMS v4.7.1 and earlier allows remote attackers to obtain sensitive information via the \u0027FileManager.editFile()\u0027 function in the component \u0027modules/filemanager/FileManagerController.java\u0027.",
"id": "GHSA-29h6-3fpg-r7jh",
"modified": "2022-07-13T00:00:44Z",
"published": "2022-05-24T19:14:39Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-19154"
},
{
"type": "WEB",
"url": "https://www.seebug.org/vuldb/ssvid-97882"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-29MX-8R38-HFXQ
Vulnerability from github – Published: 2023-07-31 15:30 – Updated: 2024-03-21 03:35** UNSUPPORTED WHEN ASSIGNED ** Authentication Bypass vulnerability in D-Link DIR-859 FW105b03 allows remote attackers to gain escalated privileges via via phpcgi_main. NOTE: This vulnerability only affects products that are no longer supported by the maintainer.
{
"affected": [],
"aliases": [
"CVE-2023-36092"
],
"database_specific": {
"cwe_ids": [
"CWE-863"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-07-31T14:15:10Z",
"severity": "CRITICAL"
},
"details": "** UNSUPPORTED WHEN ASSIGNED ** Authentication Bypass vulnerability in D-Link DIR-859 FW105b03 allows remote attackers to gain escalated privileges via via phpcgi_main. NOTE: This vulnerability only affects products that are no longer supported by the maintainer.",
"id": "GHSA-29mx-8r38-hfxq",
"modified": "2024-03-21T03:35:36Z",
"published": "2023-07-31T15:30:25Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-36092"
},
{
"type": "WEB",
"url": "https://www.dlink.com/en/security-bulletin"
},
{
"type": "WEB",
"url": "https://www.dlink.com/en/support"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-29VR-79W7-P649
Vulnerability from github – Published: 2022-03-11 00:02 – Updated: 2023-07-31 20:36Duplicate Advisory
This advisory has been withdrawn because it is a duplicate of GHSA-9w7f-m4j4-j3xw. This link is maintained to preserve external references.
Original Description
An Access Control vunerabiity exists in Gerapy v 0.9.7 via the spider parameter in project_configure function.
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "gerapy"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.9.8"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2021-44597"
],
"database_specific": {
"cwe_ids": [
"CWE-863"
],
"github_reviewed": true,
"github_reviewed_at": "2022-03-28T14:23:45Z",
"nvd_published_at": "2022-03-10T21:15:00Z",
"severity": "CRITICAL"
},
"details": "## Duplicate Advisory\nThis advisory has been withdrawn because it is a duplicate of GHSA-9w7f-m4j4-j3xw. This link is maintained to preserve external references.\n\n## Original Description\nAn Access Control vunerabiity exists in Gerapy v 0.9.7 via the spider parameter in project_configure function.",
"id": "GHSA-29vr-79w7-p649",
"modified": "2023-07-31T20:36:31Z",
"published": "2022-03-11T00:02:00Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-44597"
},
{
"type": "WEB",
"url": "https://github.com/Gerapy/Gerapy/issues/219"
},
{
"type": "WEB",
"url": "https://github.com/Gerapy/Gerapy/commit/49bcb19be5e0320e7e1535f34fe00f16a3cf3b28"
},
{
"type": "PACKAGE",
"url": "https://github.com/Gerapy/Gerapy"
},
{
"type": "WEB",
"url": "https://github.com/Gerapy/Gerapy/releases/tag/v0.9.8"
},
{
"type": "WEB",
"url": "https://github.com/pypa/advisory-database/tree/main/vulns/gerapy/PYSEC-2022-228.yaml"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Duplicate Advisory: Incorrect Authorization in Gerapy",
"withdrawn": "2023-07-31T20:36:31Z"
}
GHSA-2C59-QQ5M-3QF7
Vulnerability from github – Published: 2022-05-13 01:44 – Updated: 2022-05-13 01:44Splunk Web in Splunk Enterprise 7.0.x before 7.0.0.1, 6.6.x before 6.6.3.2, 6.5.x before 6.5.6, 6.4.x before 6.4.9, and 6.3.x before 6.3.12, when the SAML authType is enabled, mishandles SAML, which allows remote attackers to bypass intended access restrictions or conduct impersonation attacks.
{
"affected": [],
"aliases": [
"CVE-2017-17067"
],
"database_specific": {
"cwe_ids": [
"CWE-863"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2017-11-30T02:29:00Z",
"severity": "CRITICAL"
},
"details": "Splunk Web in Splunk Enterprise 7.0.x before 7.0.0.1, 6.6.x before 6.6.3.2, 6.5.x before 6.5.6, 6.4.x before 6.4.9, and 6.3.x before 6.3.12, when the SAML authType is enabled, mishandles SAML, which allows remote attackers to bypass intended access restrictions or conduct impersonation attacks.",
"id": "GHSA-2c59-qq5m-3qf7",
"modified": "2022-05-13T01:44:15Z",
"published": "2022-05-13T01:44:15Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2017-17067"
},
{
"type": "WEB",
"url": "https://www.splunk.com/view/SP-CAAAP3K"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/102005"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-2C6V-8R3V-GH6P
Vulnerability from github – Published: 2026-02-17 18:43 – Updated: 2026-02-19 21:14Summary
An access control bypass vulnerability in Gogs web interface allows any repository collaborator with Write permissions to delete protected branches (including the default branch) by sending a direct POST request, completely bypassing the branch protection mechanism. This vulnerability enables privilege escalation from Write to Admin level, allowing low-privilege users to perform dangerous operations that should be restricted to administrators only.
Although Git Hook layer correctly prevents protected branch deletion via SSH push, the web interface deletion operation does not trigger Git Hooks, resulting in complete bypass of protection mechanisms.
Details
Affected Component
- File:
internal/route/repo/branch.go - Function:
DeleteBranchPost(lines 110-155) - Route Configuration:
internal/cmd/web.go:589go m.Post("/delete/*", reqSignIn, reqRepoWriter, repo.DeleteBranchPost)
Root Cause
The DeleteBranchPost function performs the following checks when deleting a branch:
1. ✅ User authentication (reqSignIn)
2. ✅ Write permission check (reqRepoWriter)
3. ✅ Branch existence verification
4. ✅ CommitID matching (optional parameter)
5. ❌ Missing protected branch check
6. ❌ Missing default branch check
While the UI layer (internal/route/repo/issue.go:646-658) correctly checks protected branch status and hides the delete button, attackers can directly construct POST requests to bypass UI restrictions.
Vulnerable Code
Vulnerable implementation (internal/route/repo/branch.go:110-155):
```110:155:internal/route/repo/branch.go func DeleteBranchPost(c context.Context) { branchName := c.Params("") commitID := c.Query("commit")
defer func() {
redirectTo := c.Query("redirect_to")
if !tool.IsSameSiteURLPath(redirectTo) {
redirectTo = c.Repo.RepoLink
}
c.Redirect(redirectTo)
}()
if !c.Repo.GitRepo.HasBranch(branchName) {
return
}
if len(commitID) > 0 {
branchCommitID, err := c.Repo.GitRepo.BranchCommitID(branchName)
if err != nil {
log.Error("Failed to get commit ID of branch %q: %v", branchName, err)
return
}
if branchCommitID != commitID {
c.Flash.Error(c.Tr("repo.pulls.delete_branch_has_new_commits"))
return
}
}
// 🔴 Vulnerability: Missing protected branch check here
// Should add check like:
// protectBranch, err := database.GetProtectBranchOfRepoByName(c.Repo.Repository.ID, branchName)
// if protectBranch != nil && protectBranch.Protected { ... }
if err := c.Repo.GitRepo.DeleteBranch(branchName, git.DeleteBranchOptions{
Force: true,
}); err != nil {
log.Error("Failed to delete branch %q: %v", branchName, err)
return
}
if err := database.PrepareWebhooks(c.Repo.Repository, database.HookEventTypeDelete, &api.DeletePayload{
Ref: branchName,
RefType: "branch",
PusherType: api.PUSHER_TYPE_USER,
Repo: c.Repo.Repository.APIFormatLegacy(nil),
Sender: c.User.APIFormat(),
}); err != nil {
log.Error("Failed to prepare webhooks for %q: %v", database.HookEventTypeDelete, err)
return
}
}
**Correct implementation in Git Hook** (`internal/cmd/hook.go:122-125`):
```go
// check and deletion
if newCommitID == git.EmptyID {
fail(fmt.Sprintf("Branch '%s' is protected from deletion", branchName), "")
}
Correct UI layer check (internal/route/repo/issue.go:646-658):
protectBranch, err := database.GetProtectBranchOfRepoByName(pull.BaseRepoID, pull.HeadBranch)
if err != nil {
if !database.IsErrBranchNotExist(err) {
c.Error(err, "get protect branch of repository by name")
return
}
} else {
branchProtected = protectBranch.Protected
}
c.Data["IsPullBranchDeletable"] = pull.BaseRepoID == pull.HeadRepoID &&
c.Repo.IsWriter() && c.Repo.GitRepo.HasBranch(pull.HeadBranch) &&
!branchProtected // UI layer has check, but backend doesn't
PoC
Prerequisites
- Have Write permissions to the target repository (collaborator or team member)
- Target repository has protected branches configured (e.g., main, master, develop)
- Access to Gogs web interface
Send Malicious POST Request
# Directly send DELETE request bypassing UI protection
curl -X POST \
-b cookies.txt \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "_csrf=YOUR_CSRF_TOKEN" \
"https://gogs.example.com/username/repo/branches/delete/main"
Impact
- Bypass branch protection mechanism: The core function of protected branches is to prevent deletion, and this vulnerability completely undermines this mechanism
- Delete default branch: Can cause repository to become inaccessible (git clone/pull failures)
- Bypass code review: After deleting protected branch, can push new branch bypassing Pull Request requirements
- Privilege escalation: Writer permission users can perform operations that should only be allowed for Admins
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "gogs.io/gogs"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.14.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-25232"
],
"database_specific": {
"cwe_ids": [
"CWE-863"
],
"github_reviewed": true,
"github_reviewed_at": "2026-02-17T18:43:00Z",
"nvd_published_at": "2026-02-19T07:17:45Z",
"severity": "HIGH"
},
"details": "## Summary\n\nAn access control bypass vulnerability in Gogs web interface allows any repository collaborator with Write permissions to delete protected branches (including the default branch) by sending a direct POST request, completely bypassing the branch protection mechanism. This vulnerability enables privilege escalation from Write to Admin level, allowing low-privilege users to perform dangerous operations that should be restricted to administrators only.\n\nAlthough Git Hook layer correctly prevents protected branch deletion via SSH push, the web interface deletion operation does not trigger Git Hooks, resulting in complete bypass of protection mechanisms.\n\n## Details\n\n### Affected Component\n\n- **File**: `internal/route/repo/branch.go`\n- **Function**: `DeleteBranchPost` (lines 110-155)\n- **Route Configuration**: `internal/cmd/web.go:589`\n ```go\n m.Post(\"/delete/*\", reqSignIn, reqRepoWriter, repo.DeleteBranchPost)\n ```\n\n### Root Cause\n\nThe `DeleteBranchPost` function performs the following checks when deleting a branch:\n1. \u2705 User authentication (`reqSignIn`)\n2. \u2705 Write permission check (`reqRepoWriter`)\n3. \u2705 Branch existence verification\n4. \u2705 CommitID matching (optional parameter)\n5. \u274c **Missing protected branch check**\n6. \u274c **Missing default branch check**\n\nWhile the UI layer (`internal/route/repo/issue.go:646-658`) correctly checks protected branch status and hides the delete button, attackers can directly construct POST requests to bypass UI restrictions.\n\n### Vulnerable Code\n\n**Vulnerable implementation** (`internal/route/repo/branch.go:110-155`):\n\n```110:155:internal/route/repo/branch.go\nfunc DeleteBranchPost(c *context.Context) {\n\tbranchName := c.Params(\"*\")\n\tcommitID := c.Query(\"commit\")\n\n\tdefer func() {\n\t\tredirectTo := c.Query(\"redirect_to\")\n\t\tif !tool.IsSameSiteURLPath(redirectTo) {\n\t\t\tredirectTo = c.Repo.RepoLink\n\t\t}\n\t\tc.Redirect(redirectTo)\n\t}()\n\n\tif !c.Repo.GitRepo.HasBranch(branchName) {\n\t\treturn\n\t}\n\tif len(commitID) \u003e 0 {\n\t\tbranchCommitID, err := c.Repo.GitRepo.BranchCommitID(branchName)\n\t\tif err != nil {\n\t\t\tlog.Error(\"Failed to get commit ID of branch %q: %v\", branchName, err)\n\t\t\treturn\n\t\t}\n\n\t\tif branchCommitID != commitID {\n\t\t\tc.Flash.Error(c.Tr(\"repo.pulls.delete_branch_has_new_commits\"))\n\t\t\treturn\n\t\t}\n\t}\n\n\t// \ud83d\udd34 Vulnerability: Missing protected branch check here\n\t// Should add check like:\n\t// protectBranch, err := database.GetProtectBranchOfRepoByName(c.Repo.Repository.ID, branchName)\n\t// if protectBranch != nil \u0026\u0026 protectBranch.Protected { ... }\n\n\tif err := c.Repo.GitRepo.DeleteBranch(branchName, git.DeleteBranchOptions{\n\t\tForce: true,\n\t}); err != nil {\n\t\tlog.Error(\"Failed to delete branch %q: %v\", branchName, err)\n\t\treturn\n\t}\n\n\tif err := database.PrepareWebhooks(c.Repo.Repository, database.HookEventTypeDelete, \u0026api.DeletePayload{\n\t\tRef: branchName,\n\t\tRefType: \"branch\",\n\t\tPusherType: api.PUSHER_TYPE_USER,\n\t\tRepo: c.Repo.Repository.APIFormatLegacy(nil),\n\t\tSender: c.User.APIFormat(),\n\t}); err != nil {\n\t\tlog.Error(\"Failed to prepare webhooks for %q: %v\", database.HookEventTypeDelete, err)\n\t\treturn\n\t}\n}\n```\n\n**Correct implementation in Git Hook** (`internal/cmd/hook.go:122-125`):\n\n```go\n// check and deletion\nif newCommitID == git.EmptyID {\n fail(fmt.Sprintf(\"Branch \u0027%s\u0027 is protected from deletion\", branchName), \"\")\n}\n```\n\n**Correct UI layer check** (`internal/route/repo/issue.go:646-658`):\n\n```go\nprotectBranch, err := database.GetProtectBranchOfRepoByName(pull.BaseRepoID, pull.HeadBranch)\nif err != nil {\n\tif !database.IsErrBranchNotExist(err) {\n\t\tc.Error(err, \"get protect branch of repository by name\")\n\t\treturn\n\t}\n} else {\n\tbranchProtected = protectBranch.Protected\n}\n\nc.Data[\"IsPullBranchDeletable\"] = pull.BaseRepoID == pull.HeadRepoID \u0026\u0026\n\tc.Repo.IsWriter() \u0026\u0026 c.Repo.GitRepo.HasBranch(pull.HeadBranch) \u0026\u0026\n\t!branchProtected // UI layer has check, but backend doesn\u0027t\n```\n## PoC\n\n### Prerequisites\n\n1. Have Write permissions to the target repository (collaborator or team member)\n2. Target repository has protected branches configured (e.g., main, master, develop)\n3. Access to Gogs web interface\n\n#### Send Malicious POST Request\n```bash\n# Directly send DELETE request bypassing UI protection\ncurl -X POST \\\n -b cookies.txt \\\n -H \"Content-Type: application/x-www-form-urlencoded\" \\\n -d \"_csrf=YOUR_CSRF_TOKEN\" \\\n \"https://gogs.example.com/username/repo/branches/delete/main\"\n```\n\u003cimg width=\"1218\" height=\"518\" alt=\"image\" src=\"https://github.com/user-attachments/assets/745da7c3-6139-408c-9747-ccbe9ea8548f\" /\u003e\n\n## Impact\n- **Bypass branch protection mechanism**: The core function of protected branches is to prevent deletion, and this vulnerability completely undermines this mechanism\n- **Delete default branch**: Can cause repository to become inaccessible (git clone/pull failures)\n- **Bypass code review**: After deleting protected branch, can push new branch bypassing Pull Request requirements\n- **Privilege escalation**: Writer permission users can perform operations that should only be allowed for Admins",
"id": "GHSA-2c6v-8r3v-gh6p",
"modified": "2026-02-19T21:14:56Z",
"published": "2026-02-17T18:43:00Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/gogs/gogs/security/advisories/GHSA-2c6v-8r3v-gh6p"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-25232"
},
{
"type": "WEB",
"url": "https://github.com/gogs/gogs/pull/8124"
},
{
"type": "WEB",
"url": "https://github.com/gogs/gogs/commit/7b7e38c88007a7c482dbf31efff896185fd9b79c"
},
{
"type": "PACKAGE",
"url": "https://github.com/gogs/gogs"
},
{
"type": "WEB",
"url": "https://github.com/gogs/gogs/releases/tag/v0.14.1"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "Gogs has a Protected Branch Deletion Bypass in Web Interface"
}
Mitigation
- Divide the product into anonymous, normal, privileged, and administrative areas. Reduce the attack surface by carefully mapping roles with data and functionality. Use role-based access control (RBAC) [REF-229] to enforce the roles at the appropriate boundaries.
- Note that this approach may not protect against horizontal authorization, i.e., it will not protect a user from attacking others with the same role.
Mitigation
Ensure that access control checks are performed related to the business logic. These checks may be different than the access control checks that are applied to more generic resources such as files, connections, processes, memory, and database records. For example, a database may restrict access for medical records to a specific database user, but each record might only be intended to be accessible to the patient and the patient's doctor [REF-7].
Mitigation MIT-4.4
Strategy: Libraries or Frameworks
- Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.
- For example, consider using authorization frameworks such as the JAAS Authorization Framework [REF-233] and the OWASP ESAPI Access Control feature [REF-45].
Mitigation
- For web applications, make sure that the access control mechanism is enforced correctly at the server side on every page. Users should not be able to access any unauthorized functionality or information by simply requesting direct access to that page.
- One way to do this is to ensure that all pages containing sensitive information are not cached, and that all such pages restrict access to requests that are accompanied by an active and authenticated session token associated with a user who has the required permissions to access that page.
Mitigation
Use the access control capabilities of your operating system and server environment and define your access control lists accordingly. Use a "default deny" policy when defining these ACLs.
No CAPEC attack patterns related to this CWE.