🛡️ CVE-2026-59763 — gitea.dev

⚪ Unknown ✅ No Known Exploit CWE-770 OSV
N/A
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Gitea: Unbounded Arch package file metadata can cause resource amplification in Gitea package uploads

Summary

Hello Gitea Security Team,

Thank you for your continued work on Gitea. I would like to responsibly report a potential availability-impact issue that I observed in Gitea’s Arch package registry implementation.

During local testing, I noticed that Gitea records non-dot regular file entries from an uploaded Arch package archive into package file metadata. I could not identify an explicit limit on the number of recorded file entries or on the cumulative size of recorded file names before this metadata is serialized, stored, and later used during repository index generation.

As a result, a relatively small compressed .pkg.tar.gz archive may lead to significantly larger server-side metadata processing and storage. I tested this only against a local self-hosted Gitea instance and have not tested this against any third-party or production service.

Suggested Severity

Suggested severity: Medium

Suggested CVSS 3.1 vector:

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L

Suggested CVSS score: 4.3

This assessment is only a suggestion. The issue appears to require an authenticated user with package publishing permission. However, once that condition is met, the behavior is reachable over the network, does not require user interaction, and may affect availability through amplified metadata parsing, serialization, database storage, and repository index generation.

Affected Component

  • Gitea package registry
  • Arch package upload endpoint
  • Arch package metadata parsing
  • Arch repository index generation

Technical Details

The upload flow appears to accept an Arch package archive, parse its contents, record file entries into package metadata, and later reuse that metadata when generating the Arch repository index.

The relevant flow appears to include:

  • routers/api/packages/arch/arch.go:46 accepts the upload stream.
  • routers/api/packages/arch/arch.go:55 copies the upload into a HashedBuffer.
  • routers/api/packages/arch/arch.go:62 parses the archive with arch_module.ParsePackage.
  • modules/packages/arch/metadata.go:149 appends each non-dot regular tar entry name to files.
  • modules/packages/arch/metadata.go:158 stores the full list as p.FileMetadata.Files.
  • routers/api/packages/arch/arch.go:77 JSON-marshals the file metadata.
  • routers/api/packages/arch/arch.go:143 persists the metadata as arch_module.PropertyMetadata.
  • services/packages/arch/repository.go:302 deserializes the metadata during index generation.
  • services/packages/arch/repository.go:365 joins the full file list into the generated files entry.

From my review, the package upload size limit can reduce the maximum compressed archive size that is accepted, but it does not appear to directly limit the number of file entries or the expanded metadata size for archives that remain below the compressed upload limit.

Impact

An authenticated user with permission to publish Arch packages may be able to upload an archive containing a valid .PKGINFO file and a large number of empty regular file entries.

In my local test environment, Gitea accepted such packages and stored the full file list as package metadata. This caused the server-side metadata size and generated repository files index content to become much larger than the compressed upload size.

The practical impact appears to be resource amplification affecting:

  • CPU usage during parsing and index generation
  • memory usage during metadata handling
  • database storage due to large serialized metadata
  • repository index generation size and processing time

This seems most relevant for instances where untrusted or semi-trusted users are allowed to publish packages.

Local Validation Results

I tested this only on a local self-hosted Gitea instance.

A 470,403 byte archive containing 100,000 empty file entries was accepted by the Arch package upload endpoint. It produced a 4,500,112 byte arch.metadata database property and a generated repository index whose files member contained 100,001 lines.

A larger 2,349,767 byte archive containing 500,000 empty file entries was also accepted in the default configuration. It produced a 22,500,112 byte arch.metadata database property and a generated repository files member with 500,001 lines.

Proof of Concept

The following proof of concept is intended only for a local self-hosted test instance.

Save the following script as generate_arch_metadata_test_package.py:

```python

#!/usr/bin/env python3

from __future__ import annotations

import argparse

import gzip

import io

import tarfile

from pathlib import Path

PKGINFO = """pkgname = gitea-metadata-test

pkgbase = gitea-metadata-test

pkgver = 1.0.0-1

pkgdesc = Local metadata scaling test package

url = https://example.invalid/

packager = local test

arch = x86_64

license = MIT

builddate = 1714521600

size = 0

"""

def add_bytes(tar: tarfile.

How this vulnerability can be exploited

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

Weakness class

CVE-2026-59763 is classified as CWE-770: Allocation of Resources Without Limits. Resources are allocated on request with no cap, so a client can exhaust them.

Affected software

CVE-2026-59763 is recorded against 2 packages.

  • code.gitea.io/gitea
  • gitea.dev

Timeline and source

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

References

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

Details

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

Affected Packages

Software From version Fixed in
code.gitea.io/gitea
gitea.dev

Similar Threats

Free Vulnerability Check

Is your site affected by CVE-2026-59763?

BotEraser helps you identify potentially vulnerable plugins and themes by checking your installation against CVE-2026-59763 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.