🛡️ CVE-2026-58438 — gitea.dev

🟢 CVSS 2.0 — Low ✅ No Known Exploit CWE-862 OSV
2.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Gitea: Cross-repository IDOR in issue-dependency removal lets an attacker tamper with and comment on private repos they cannot access

Details

RemoveDependency in routers/web/repo/issue_dependency.go takes a removeDependencyID form parameter identifying the other issue by its global numeric ID, and fetches it with issues_model.GetIssueByID(ctx, depID) - no repository or permission check at all. It then calls issues_model.RemoveIssueDependency(ctx, ctx.Doer, issue, dep, depType) (models/issues/dependency.go), which deletes the dependency join row and then writes a comment referencing the removal, attributed to the calling user, onto the dependency record.

The sibling function in the very same file, AddDependency, does this correctly when the two issues are in different repos (which ALLOW_CROSS_REPOSITORY_DEPENDENCIES, on by default, permits):

```go

if issue.RepoID != dep.RepoID {

if !setting.Service.AllowCrossRepositoryDependencies { ... }

depRepoPerm, err := access_model.GetDoerRepoPermission(ctx, dep.Repo, ctx.Doer)

if !depRepoPerm.CanReadIssuesOrPulls(dep.IsPull) {

return // you can't see this dependency

}

}

```

RemoveDependency has no equivalent block at all - it goes straight from resolving dep by ID to deleting the link, regardless of which repo dep lives in or whether the caller can see it. I confirmed this same code is present in the current latest release, v1.26.4.

PoC

Prerequisites: an account with write access to issues on some repo ownerA/repoA, and the global numeric issue ID of an issue in a private repo repoB that is (or was) legitimately dependency-linked to one of the attacker's issues in repoA (cross-repo dependencies are commonly used between related public/private repos, and ALLOW_CROSS_REPOSITORY_DEPENDENCIES defaults to enabled).

```bash

curl -s -b "gitea_session=$ATTACKER_SESSION_COOKIE" -X POST \

--data-urlencode "removeDependencyID=<repoB_issue_global_id>" \

--data-urlencode "dependencyType=blockedBy" \

"https://TARGET_HOST/ownerA/repoA/issues/N/dependency/delete"

# Expected: the dependency link is deleted and a "removed dependency" comment

# authored by the attacker is added to the repoB issue, even though the

# attacker has no read access to repoB.

```

Impact

This is a cross-repository IDOR / broken access control issue. An attacker can tamper with issue-tracking state (dependency relationships) and inject an attacker-authored comment into a private repository they cannot otherwise read or write to, crossing a trust boundary the "add" path explicitly enforces. Impact is bounded - it requires an existing dependency link and discloses no repository content - but it is a genuine unauthorized-write primitive across a private-repo boundary.

Fix

Add the same cross-repo permission check used in AddDependency (access_model.GetDoerRepoPermission(ctx, dep.Repo, ctx.Doer).CanReadIssuesOrPulls(dep.IsPull)) to RemoveDependency before allowing the deletion to proceed when issue.RepoID != dep.RepoID.

If possible, please apply for a CVE number when publishing. I would greatly appreciate it.

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is high, an attacker needs low-level privileges on the target. No user interaction is required. Rated impact: confidentiality none, integrity low, availability none.

Weakness class

CVE-2026-58438 is classified as CWE-862: Missing Authorization. No authorisation check is performed before carrying out a restricted action.

Affected software

CVE-2026-58438 is recorded against 1 package.

  • gitea.dev

Timeline and source

Published on 21 July 2026 and last revised on 27 July 2026. No public exploit is currently recorded for this entry. Record sourced from OSV.

References

github.com (Web)
github.com (Package)
github.com (Web)

Details

Severity LOW
CVSS Score 2.0
CVSS Vector CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:L/SA:N
CWE CWE-862
Public Exploit ✅ No
Source OSV
Published 2026-07-21
Updated 2026-08-12
Modified 2026-07-27
Fix URL N/A

Affected Packages

Software From version Fixed in
gitea.dev

Similar Threats

Free Vulnerability Check

Is your site affected by CVE-2026-58438?

BotEraser helps you identify potentially vulnerable plugins and themes by checking your installation against CVE-2026-58438 and other known CVE records.

Scan My Site Free →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.