---
id: "CVE-2026-107891"
kind: "vulnerability"
aliases: ["CVE-2026-107891"]
title: "musl libc: regcomp integer overflows allow out-of-bounds heap writes"
severity: "high"
cvss: 8.1
epss: null
exploited: false
status: "open"
category: "runtime"
products: []
ecosystems: []
tags: ["alpine", "c", "containers", "musl", "runtime"]
not_affected_if: ["fixed-regex-patterns", "glibc-systems"]
published_at: "2026-11-05T16:17:32+00:00"
first_seen_at: "2026-11-05T16:40:01+00:00"
updated_at: "2026-11-05T16:41:24+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-107891", "first_seen_at": "2026-11-05T16:40:01+00:00"}]
exploit_sources: []
---

# musl libc: regcomp integer overflows allow out-of-bounds heap writes

musl libc before 1.2.7 has multiple integer overflows in regcomp when an untrusted regular expression is compiled, which can produce incorrect allocation sizes. The resulting out-of-bounds heap writes could let an attacker corrupt memory and potentially run code in the affected program.

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

## How to check

- Run `ldd --version` or check the musl version of the system (`/lib/ld-musl-*.so.1`) and compare it against `1.2.7`.
- Find programs that compile user-supplied regular expressions with `regcomp` on Alpine or other musl-based systems.

## Fix

- musl libc: upgrade to `1.2.7` or later.

## Timeline

- 2026-11-05T16:40:01+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-107891

## Documents

- [discussion] CVE-2026-107891: musl Libc Integer Overflow in regcomp Leading to Heap Issues https://news.ycombinator.com/item?id=50230132

## From the sources

musl libc before 1.2.7, when an untrusted regular expression is used with regcomp, has multiple integer overflows, possibly leading to incorrect allocation sizes and out-of-bounds heap writes.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
