---
id: "CVE-2026-107840"
kind: "vulnerability"
aliases: ["CVE-2026-107840", "GHSA-6r69-c6wg-7g8m", "GO-2026-6720"]
title: "yopass Prometheus metrics middleware allows remote memory exhaustion through unbounded method labels in github.com/jhaals/yopass"
severity: "high"
cvss: 7.5
epss: 0.00444
exploited: false
status: "open"
category: "package"
products: [{"name": "github.com/jhaals/yopass", "fixed": ["0.0.0-20260727191436-61e31ead04a4"], "affected": "< 0.0.0-20260727191436-61e31ead04a4", "ecosystem": "go"}]
ecosystems: ["go"]
tags: ["go", "package", "prometheus", "self-hosted", "yopass"]
not_affected_if: ["metrics-disabled", "version-14.7.0-or-later"]
published_at: "2026-10-09T18:17:05+00:00"
first_seen_at: "2026-10-23T19:13:08+00:00"
updated_at: "2026-10-23T19:55:58+00:00"
sources: [{"source": "govuln", "url": "https://pkg.go.dev/vuln/GO-2026-6720", "first_seen_at": "2026-10-23T19:13:08+00:00"}, {"source": "epss", "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-107840", "first_seen_at": "2026-10-23T19:13:43+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-107840", "first_seen_at": "2026-10-23T19:35:23+00:00"}]
---

# yopass Prometheus metrics middleware allows remote memory exhaustion through unbounded method labels in github.com/jhaals/yopass

yopass, a service for sharing secrets, lets any unauthenticated client send requests with arbitrary HTTP method names, and its metrics middleware stores each one as a new Prometheus label. An attacker can flood the server with unique methods so memory grows until the process is OOM-killed, and /metrics slows or stops being useful.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- go:github.com/jhaals/yopass affected < 0.0.0-20260727191436-61e31ead04a4 fixed 0.0.0-20260727191436-61e31ead04a4

## How to check

Check the module version in go.mod for github.com/jhaals/yopass; anything before 0.0.0-20260727191436-61e31ead04a4 (upstream release 14.7.0) is affected.
Watch yopass_http_requests_total label cardinality on /metrics for a growing number of distinct method values.

## Fix

Upgrade github.com/jhaals/yopass to 0.0.0-20260727191436-61e31ead04a4 or later (release 14.7.0).
Until upgraded, put a reverse proxy in front that rejects non-standard HTTP methods.

## Timeline

- 2026-10-23T19:13:08+00:00 govuln https://pkg.go.dev/vuln/GO-2026-6720
- 2026-10-23T19:13:43+00:00 epss https://api.first.org/data/v1/epss?cve=CVE-2026-107840
- 2026-10-23T19:35:23+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-107840

## From the sources

yopass is a service for securely sharing secrets, passwords, and files. Prior to version 14.7.0, the Prometheus metrics middleware in pkg/server/server.go uses the attacker-controlled r.Method value directly as the method label for yopass_http_requests_total and yopass_http_request_duration_seconds. Because the catch-all route accepts arbitrary HTTP method tokens, an unauthenticated remote attacker can submit many unique methods and create metric series that the Prometheus registry never evicts. The resulting monotonic memory growth can OOM-kill the process, while the expanding registry also degrades /metrics scrape latency and can blind monitoring. This issue is fixed in version 14.7.0.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
