# CVE-2026-107189: Integer overflow in GNU m4 reload_frozen_state() (all versions through 1.4.21)

> CERT Polska reports an integer overflow or wraparound (CWE-190) in GNU m4's reload_frozen_state() in src/freeze.c. A malicious frozen-state file passed via the -R option triggers an oversized allocation request that crashes m4, causing denial of service. All versions through 1.4.21 are affected; fixed in upstream commit 69aef802fb25ab600d37210f44e5128633cbc432.

- **Published:** 2026-11-27T12:21:08Z
- **Last reviewed:** 2026-11-27T12:21:08Z
- **Canonical:** https://intel.threadlinqs.com/threat/TL-2026-6982
- **Card image:** https://intel.threadlinqs.com/og/threat/TL-2026-6982.png
- **ID:** TL-2026-6982
- **Severity:** LOW
- **Category:** VULNERABILITY
- **Status:** TRACKING
- **Detections:** 9 (1 shown free below) · **IOCs:** 6 (1 shown free below)
- **CVEs:** CVE-2026-107189

## Description

GNU m4 is a macro processor used widely as a build-time dependency (notably by GNU Autoconf and by programs such as sendmail that run m4 over configuration rules). CERT Polska published advisory CVE-2026-107189 on 2026-11-27. It describes an integer overflow in reload_frozen_state() in src/freeze.c. When m4 processes a malicious frozen-state file supplied with the -R (--reload-state) option, an attacker can trigger an oversized allocation request that crashes the program, resulting in denial of service. The advisory states that all versions through 1.4.21 are affected and that the issue was fixed in commit 69aef802fb25ab600d37210f44e5128633cbc432. The advisory credits Michal Majchrowicz and Marcin Wyczechowski of the AFINE Team for the responsible report. CERT Polska did not publish a CVSS score or vector, a fixed release number, or any statement of in-the-wild exploitation.

Technical background from the public bug-m4 mailing list: on 2026-03-16 a researcher (Zhihan Zheng, Beijing Institute of Technology, who said the finding came from an automated vulnerability discovery framework) reported a related issue in the frozen-state reload path of m4 1.4.21. The report states that the length parsed from the frozen file is stored in an int; a crafted value such as 2147483647 makes the expression number[i] + 1 overflow in the check 'if (number[i] + 1 > allocated[i])', followed by allocated[i] = number[i] + 1 and string[i] = xcharalloc((size_t) allocated[i]), leading to abnormal allocation and a deterministic crash during 'm4 -R'. Locations cited were src/freeze.c lines 205-217, 245-259 and 323-325. This mailing-list report does not itself reference CVE-2026-107189, so its mapping to the CERT Polska CVE is inferred from the matching component and weakness, not confirmed by the advisory.

Impact is limited. Maintainer Eric Blake noted on the list that because m4 offers syscmd(), m4 is usually not a security boundary; the notable exception is programs such as sendmail that run m4 on user-supplied rules. The reporter noted that autoconf uses frozen files but assumes they are not malicious. Exploitation requires that an attacker can get m4 to reload an attacker-controlled frozen-state file. No public PoC file, exploitation in the wild, threat actor, or network infrastructure is reported in any source. The severity of LOW is an analyst placeholder (availability-only impact, no published score).

## MITRE ATT&CK

- T1190 Exploit Public-Facing Application
- T1195.001 Compromise Software Dependencies and Development Tools
- T1204.002 Malicious File
- T1499.004 Application or System Exploitation

## Free detection (Splunk SPL, Microsoft KQL, Sigma)

**Exploitation — m4 Reloading Frozen-State File (-R / --reload-state) [Splunk SPL]** (`TL-2026-6982-SPL-001`)

Process-creation detection of GNU m4 invoked with -R / --reload-state, the only path into reload_frozen_state() in src/freeze.c where the CVE-2026-107189 integer overflow (CWE-190, number[i] + 1 with 2147483647) is triggered. Extracts the frozen-state file (*.m4f) for triage. Technique mapping: T1190/T1204.002 come from the research; T1204 (parent) and T1203 (exploitation of a local application via a crafted file) are analyst-inferred. No in-the-wild exploitation is reported; use for exposure hunting and attempted-exploitation alerting on m4 through 1.4.21.

- **Languages:** Splunk SPL, Microsoft KQL, Sigma
- **ATT&CK:** T1190, T1204.002, T1204, T1203
- **Data sources:** sysmon_for_linux, defender_for_endpoint_linux, linux_process_creation
- **Severity:** low
- **Confidence:** medium

### Splunk SPL

```spl
index=linux sourcetype="sysmon:linux" EventCode=1 (Image="*/m4" OR Image="*/gm4")
| where match(CommandLine, "(^|\s)(-R\s*\S|--rel[a-z-]*)")
| rex field=CommandLine "(?:-R\s*|--rel[a-z-]*[=\s]+)(?<frozen_file>[^\s]+)"
| fillnull value="unparsed" frozen_file User ParentImage
| eval frozen_ext=if(match(frozen_file, "\.m4f$"), "m4f", "other")
| stats count min(_time) as first_seen max(_time) as last_seen values(CommandLine) as cmdlines values(ParentImage) as parent_processes values(frozen_ext) as frozen_ext by host User frozen_file
| convert ctime(first_seen) ctime(last_seen)
| sort - count
```

### Microsoft KQL

```kql
DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("m4", "gm4")
| where ProcessCommandLine matches regex @"(^|\s)(-R\s*\S|--rel[a-z-]*)"
| extend FrozenFile = extract(@"(?:-R\s*|--rel[a-z-]*[=\s]+)(\S+)", 1, ProcessCommandLine)
| extend FrozenExt = iff(FrozenFile endswith ".m4f", "m4f", "other")
| project Timestamp, DeviceName, AccountName, FileName, FolderPath, ProcessCommandLine, FrozenFile, FrozenExt, InitiatingProcessFileName, InitiatingProcessCommandLine
```

### Sigma

```yaml
title: GNU m4 Frozen-State Reload via -R or --reload-state (CVE-2026-107189)
id: 7c1d4e9a-52b8-4f03-a6d1-9e3b8c2f4a71
status: experimental
description: Detects execution of GNU m4 with -R / --reload-state, the only code path that reaches the vulnerable reload_frozen_state() integer overflow (CWE-190) in m4 through 1.4.21.
references:
    - https://cert.pl/en/posts/2026/11/CVE-2026-107189/
    - https://www.cve.org/CVERecord?id=CVE-2026-107189
    - https://mid.mail-archive.com/bug-m4@gnu.org/msg03627.html
author: Threadlinqs Team
date: 2026/11/27
tags:
    - attack.initial_access
    - attack.t1190
    - attack.execution
    - attack.t1204
    - attack.t1204.002
    - attack.t1203
    - cve.2026.107189
logsource:
    category: process_creation
    product: linux
detection:
    selection_img:
        Image|endswith:
            - '/m4'
            - '/gm4'
    selection_cli:
        CommandLine|re: '(^|\s)(-R\s*\S|--rel[a-z-]*)'
    condition: selection_img and selection_cli
falsepositives:
    - GNU Autoconf / autom4te legitimately reloading its own .m4f frozen files in build trees
    - Developers using frozen-state files for m4 macro libraries
level: low

```

**Known false positives:**

- GNU Autoconf/autom4te reloading its own trusted .m4f frozen files in build trees
- Developers using frozen-state files to speed up large m4 macro libraries

**Tuning notes:** Baseline m4 -R usage in build pipelines for 7-14 days and allowlist known build users, parent processes (autom4te, make) and trusted frozen-file paths. Regexes are case-sensitive so m4 -r (regexp-syntax) does not match. Combined short options (e.g. -PR file) are not covered. Adjust index/sourcetype to your Linux telemetry (Sysmon for Linux or auditd EXECVE).

### 8 more detection rules (Splunk SPL, Microsoft KQL, Sigma), unlock with TL Creds

- Exploitation — m4 Reloading Frozen-State File (-R / --reload-state) [Sentinel KQL] (locked: unlock with TL Creds)
- Impact — m4 Crash or Allocation Failure After Frozen-State Reload [Sentinel KQL] (locked: unlock with TL Creds)
- Supply Chain / Untrusted Input — m4 -R from Untrusted Path, Service Parent, or Transferred .m4f [Sentinel KQL] (locked: unlock with TL Creds)
- Exploitation — m4 Reloading Frozen-State File (-R / --reload-state) [Sigma] (locked: unlock with TL Creds)
- Impact — m4 Crash or Allocation Failure After Frozen-State Reload [Sigma] (locked: unlock with TL Creds)
- Supply Chain / Untrusted Input — m4 -R from Untrusted Path, Service Parent, or Transferred .m4f [Sigma] (locked: unlock with TL Creds)
- Impact — m4 Crash or Allocation Failure After Frozen-State Reload [Splunk SPL] (locked: unlock with TL Creds)
- Supply Chain / Untrusted Input — m4 -R from Untrusted Path, Service Parent, or Transferred .m4f [Splunk SPL] (locked: unlock with TL Creds)

Sign up free to unlock the detection rules: https://threadlinqs.com/?modal=signup

## Sample indicators (1 of 6)

Defanged, TLP:CLEAR.

- File hash: `69aef802fb25ab600d37210f44e5128633cbc432`

Full set of 6 indicators unlocks with TL Creds: https://threadlinqs.com/tl-creds

## Sources

- [CERT Polska: Vulnerability in GNU m4 software](https://cert.pl/en/posts/2026/11/CVE-2026-107189/)
- [CVE Record CVE-2026-107189](https://www.cve.org/CVERecord?id=CVE-2026-107189)
- [CWE-190: Integer Overflow or Wraparound](https://cwe.mitre.org/data/definitions/190.html)
- [bug-m4: Security Integer overflow in src/freeze.c frozen-state reload path (reply by Zhihan Zheng)](https://mid.mail-archive.com/bug-m4@gnu.org/msg03627.html)
- [bug-m4: Maintainer reply on security-report impact (Eric Blake)](https://mid.mail-archive.com/bug-m4@gnu.org/msg03625.html)
- [GNU m4 NEWS for release 1.4.21 (2026-02-06)](https://sources.debian.org/src/m4/1.4.21-1/NEWS)
- [GNU m4 ChangeLog (freeze.c integer-overflow history, stackovf branch)](https://gnu.googlesource.com/m4/+/refs/heads/stackovf/ChangeLog)
- [CERT Polska Coordinated Vulnerability Disclosure process](https://cert.pl/en/cvd/)

## Full data

The other 8 detection rules (Splunk SPL / Microsoft KQL / Sigma) unlock with TL Creds; a free account includes daily creds: https://threadlinqs.com/?modal=signup
Indicator values unlock with TL Creds, at a lower price on Red and Purple; AI agents can query rules and IOCs through the Threadlinqs MCP server (Purple and Gold in full, 2 calls a day on a free account): https://intel.threadlinqs.com/mcp

Canonical: https://intel.threadlinqs.com/threat/TL-2026-6982
