Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. code.gitea.io/gitea
  4. ›
  5. CVE-2026-56755

CVE-2026-56755: Gitea: Denial of Service (CPU & Memory Exhaustion) via O(N^2) String Concatenation in Debian Package Upload

July 21, 2026

Gitea’s Debian package registry parser contains an unbounded decompression vulnerability in ParseControlFile. When processing an uploaded .deb file, the parser decompresses control.tar.gz and copies the entire uncompressed stream into a strings.Builder via a TeeReader, with no limit on how much data is read. Because DEFLATE compression can achieve ratios exceeding 100:1 on repetitive input, an attacker can craft an 83 MB .deb payload that expands to over 16 GB during parsing, exhausting server memory before any content validation runs. A second issue compounds this: continuation lines in the Description field are concatenated with += at modules/packages/debian/metadata.go:161 inside a loop, producing O(N²) allocation and copy work that stalls the CPU even at moderate line counts. Any authenticated user with write access to the package registry can trigger a complete denial of service with a single upload request to the handler at routers/api/packages/debian/debian.go:146.

References

  • github.com/advisories/GHSA-6hm7-3pwj-22rm
  • github.com/go-gitea/gitea/commit/de4b8277e9cb576f2315fb03b5ab6478b42a1d31
  • github.com/go-gitea/gitea/commit/f69e15afe7496cc62e96dab244629c69eb31a7bf
  • github.com/go-gitea/gitea/pull/38406
  • github.com/go-gitea/gitea/pull/38426
  • github.com/go-gitea/gitea/releases/tag/v1.27.0
  • github.com/go-gitea/gitea/security/advisories/GHSA-6hm7-3pwj-22rm
  • nvd.nist.gov/vuln/detail/CVE-2026-56755

Code Behaviors & Features

Detect and mitigate CVE-2026-56755 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 1.27.0

Fixed versions

  • 1.27.0

Solution

Upgrade to version 1.27.0 or above.

Impact 6.5 MEDIUM

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

Learn more about CVSS

Weakness

  • CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)

Source file

go/code.gitea.io/gitea/CVE-2026-56755.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 08 Aug 2026 00:16:43 +0000.