Categories
CVE-2026-58442 medium CVSS 6.5

Information Disclosure in code.gitea.io/gitea (CVE-2026-58442)

Summary

Vulnerability in code.gitea.io/gitea (CVE-2026-58442). Confidential information can be exposed externally. Exploitable via ipAllowed. Mitigation: upgrade to 1.27.0 or later.

Original description

The description as published by the source.

Summary

Gitea's repository migration URL validation can be bypassed when a migration hostname resolves to multiple IP addresses. The validation logic accepts the destination if any resolved IP is allowed, even if another resolved IP is loopback, private, or otherwise blocked. The later git clone operation resolves the hostname again outside of that validation decision, so it can connect to the internal address.

An authenticated low-privilege user who can create repository migrations can use an attacker-controlled DNS name to make Gitea connect to internal-only Git services and import their contents into a repository controlled by the attacker.

Details

The issue is in services/migrations/migrate.go, in the migration allow/block-list check.

Current logic computes whether any resolved IP is allowed:

var ipAllowed bool
var ipBlocked bool
for _, addr := range addrList {
    ipAllowed = ipAllowed || allowList.MatchIPAddr(addr)
    ipBlocked = ipBlocked || blockList.MatchIPAddr(addr)
}

Then, when an allow-list is active, the host is accepted if the hostname matches or ipAllowed is true:

if !allowList.IsEmpty() {
    if !allowList.MatchHostName(hostName) && !ipAllowed {
        return &git.ErrInvalidCloneAddr{Host: hostName, IsPermissionDenied: true}
    }
}

This means a hostname resolving to both:

  • an allowed public IP, e.g. 1.2.3.4
  • a blocked internal IP, e.g. 127.0.0.1

passes validation because the public IP sets `ipAllowed =…

Source: GitHub Security Advisories (Global) NVD GitHub Advisory

Auto-generated summary

Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.

A vulnerability tracked as CVE-2026-58442 has been found in code.gitea.io/gitea.
Attackers can target a specific entry point like ipAllowed over the network to misuse the product.
Confidential information can be exposed externally. CVSS score: 6.5/10.
What to do: upgrade code.gitea.io/gitea to 1.27.0 or later.
If unsure, ask your IT team or search "code.gitea.io/gitea CVE-2026-58442" on the vendor's site.

CVE-2026-58442 (code.gitea.io/gitea) — CWE-200 / CVSS v3 6.5
Attack vector: remote (network-reachable) / no user interaction
Attack surface: ipAllowed / MigrateRepositoryGitData / gitrepo.CloneExternalRepo
Patched: 1.27.0 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.

❓ What is the problem

Information disclosure (CWE-200) exists in code.gitea.io/gitea. Attackers reach the vulnerable code path via ipAllowed.

📍 Affected scope

Check the vendor advisory for the affected versions of code.gitea.io/gitea. Attack surface: ipAllowed / MigrateRepositoryGitData / gitrepo.CloneExternalRepo.

🔥 Severity

Severity: Medium (CVSS 6.5/10). Confidential information can be exposed externally.

🔧 How to fix

Update to 1.27.0.

🛡️ Workaround

Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.

🔍 Detection

Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'code.gitea.io/gitea' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.

Response actions

Concrete steps and command examples for SOC/SRE teams to execute in order

  1. 1
    Identify exposure identify
    grep -r 'code.gitea.io/gitea' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で code.gitea.io/gitea を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Apply patch patch
    Upgrade code.gitea.io/gitea to 1.27.0

    ステージング環境で 1.27.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。

  3. 3
    Post-deployment verification verify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

Affected packages

go code.gitea.io/gitea
[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.27.0"}]}]
Go gitea.dev
[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.27.0"}]}]

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details