# GNU Guix 'guix substitute' and 'guix pull' Vulnerabilities Enable Arbitrary File Write, Metadata Spoofing, Local Secret Disclosure, and Path Traversal (CVE Pending)

> GNU Guix disclosed four security flaws on 2026-07-02: three in 'guix substitute' — a race between archive extraction and hash verification in restore-file enabling arbitrary file write (up to /etc/passwd when guix-daemon runs as root), a missing narinfo request/response binding check in fetch-narinfos allowing substitution of unintended authorized store items, and unsafe file:// URI handling that can leak local secrets via error backtraces — plus a path-traversal flaw in guix pull / guix time-machine's authenticate-channel cache-key derivation enabling denial-of-service file overwrites. No CVE IDs were assigned at disclosure time. Fixed via 11 commits merged as pull request #9665 (codeberg.org/guix/guix), final commit 897832f374dcdc9eeaf19d01e70b9a92fccfc68c.

- **Published:** 2026-07-10T00:00:00Z
- **Last reviewed:** 2026-07-10T00:00:00Z
- **Canonical:** https://intel.threadlinqs.com/threat/TL-2026-1179
- **Card image:** https://intel.threadlinqs.com/og/threat/threat-intel-gnu-guix-substitute-flaws-tl-2026-1179.webp?v=5d306db8 (Threadlinqs threat intel: GNU Guix substitute and pull Flaws: Detection & IOCs (TL-2026-1179) — High severity, 25 IOCs, 9 detection rules.)
- **ID:** TL-2026-1179
- **Severity:** HIGH
- **Category:** VULNERABILITY
- **Status:** PATCHED
- **Detections:** 9 (1 shown free below) · **IOCs:** 25 (3 shown free below)

## Description

On 2026-07-02, the GNU Guix security team published an advisory disclosing four distinct vulnerabilities affecting the 'guix substitute' helper (invoked by guix-daemon to download pre-built binary substitutes) and the 'guix pull'/'guix time-machine' channel-authentication caching logic. Guix is a functional, transactional package manager and the basis of the GNU Guix System distribution, widely used in reproducible-build and NixOS-adjacent communities.

Vulnerability 1 (primary/most severe) — the restore-file procedure in the (guix serialization) module, responsible for unpacking NAR (Nix ARchive) substitute archives, was invoked to extract archive contents as they streamed in from the network, before the complete archive's cryptographic hash could be verified against the signed narinfo metadata. restore-file additionally did not validate directory entry names for path traversal characters ('/'), null bytes, or duplicate/out-of-order entries. Because extraction happened before verification, and because entry names were unvalidated, any substitute server the client is configured to trust — or any network attacker able to impersonate one (MITM) — could serve a crafted NAR archive that wrote attacker-chosen file contents to attacker-chosen paths writable by the guix-daemon user. Since guix-daemon commonly runs as root for system-wide installs, this allowed remote overwrite of files such as /etc/passwd, i.e. remote privilege escalation to full root compromise, plus general Guix store corruption. Notably, the researcher (Jörg Thalheim, known for Nix ecosystem security work) demonstrated that even though NARs are cryptographically signed, streaming extraction before verification defeated that protection — the signature check happened too late to prevent the malicious write.

Vulnerability 2 — fetch-narinfos in guix/substitutes.scm did not verify that a narinfo returned by a substitute server actually corresponded to the store item that was requested. A malicious or compromised substitute server could return the (validly signed, 'authorized') narinfo for a different but also-authorized store item than the one requested. This allowed forced substitution of one authorized package for another authorized package, enabling downgrade-style attacks: a target system could be made to install an older, vulnerable, but still-signed version of a package instead of the one actually referenced by name/hash, silently defeating version pinning.

Vulnerability 3 — guix substitute accepted file:// URIs both as substitute-server URLs and as nar URLs embedded within narinfo responses, and followed symbolic links when resolving them. A local, unprivileged user able to connect to the guix-daemon Unix socket (the default local trust boundary) could supply crafted narinfo/URL input that caused parsing errors; the resulting error backtraces could include the contents of arbitrary files readable by the daemon user, disclosing secrets, credentials, or configuration data. The advisory also notes potential for interference with other processes via /proc/PID/fd symlink manipulation.

Vulnerability 4 — authenticate-channel in (guix channels), used by guix pull and guix time-machine to authenticate a channel's Git commit history, derived a local cache file name directly from the (attacker-influenceable) channel name without sanitization. A malicious or spoofed channels file containing a crafted channel name (e.g. containing '../../../../newfile' style traversal sequences) could cause Guix to create or overwrite files outside the intended cache directory, anywhere the invoking user can write. Primary impact is denial-of-service via unwanted file creation/overwrite; the advisory notes more creative escalation may be possible via /proc special files.

All four issues were fixed in a coordinated series of 11 commits merged 2026-07-02 (final commit 897832f374dcdc9eeaf19d01e70b9a92fccfc68c) as pull request/patchset #9665 on the project's Codeberg mirror, authored primarily by Ludovic Courtès (civodul) and collaborators. Fixes include: strict directory-entry-name validation and O_EXCL/O_NOFOLLOW-guarded extraction to a temporary location prior to hash verification in restore-file (commit c7e4429); request/response narinfo matching checks in fetch-narinfos and cached-narinfo (commit 797ec01); new %allow-unsafe-substitute-uris?/%allow-unsafe-narinfo-uris? parameters and uri-safe?/narinfo-uris-safe? validators that reject untrusted file:// URIs (commit c5fdcf7); and cache-key derivation for channel authentication changed from raw channel name to the channel's introductory commit ID with dot-to-dash sanitization, removing attacker control of the cache path (commit bfb3031). A defense-in-depth hardening of the C++ daemon-side NAR parser (nix/libutil/archive.cc) adding a DIRECTORY_NESTING_LIMIT of 256 and stricter structural validation was also merged (commit e95120), along with new valid-store-name?/valid-path-syntax? helpers (commit e27a82). No CVE identifiers had been assigned as of the 2026-07-02 advisory / 2026-07-10 secondary reporting. Disclosure timeline: Jörg Thalheim privately reported the restore-file issue on 2026-05-28; the Guix security team discovered and developed fixes for the remaining three issues between 2026-06-04 and 2026-06-24; the coordinated advisory and patch went public 2026-07-02.

## MITRE ATT&CK

- T1195 Supply Chain Compromise
- T1190 Exploit Public-Facing Application
- T1557 Adversary-in-the-Middle
- T1203 Exploitation for Client Execution
- T1505 Server Software Component
- T1195.002 Compromise Software Supply Chain
- T1068 Exploitation for Privilege Escalation
- T1574.009 Path Interception by Unquoted Path
- T1211 Exploitation for Stealth
- T1036.008 Masquerade File Type
- T1222 File and Directory Permissions Modification
- T1552.001 Credentials In Files
- T1187 Forced Authentication
- T1083 File and Directory Discovery
- T1518 Software Discovery
- T1005 Data from Local System
- T1213 Data from Information Repositories
- T1132 Data Encoding
- T1565.001 Stored Data Manipulation
- T1499 Endpoint Denial of Service
- T1531 Account Access Removal

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

**Guix Substitute NAR Extraction — Path Traversal Entry Name (Exploitation)** (`TL-2026-1179-SPL-001`)

Detects a 'guix substitute' NAR extraction event whose entry name contains directory-traversal sequences ('../', '..\\') or a null byte, matching the restore-file extraction-before-hash-verification flaw (CWE-22/CWE-367) that enables arbitrary file write up to /etc/passwd when guix-daemon runs as root.

- **Languages:** Splunk SPL, Microsoft KQL, Sigma
- **ATT&CK:** T1195, T1195.002, T1068
- **Data sources:** guix_daemon_log, file_event, sysmon
- **Severity:** critical
- **Confidence:** high

### Splunk SPL

```spl
index=guix sourcetype="guix:substitute" EventType="nar_extract"
| eval traversal=if(match(EntryName, "(\.\.[\\/])") OR match(EntryName, "\\x00"), 1, 0)
| where traversal=1
| eval daemon_user=coalesce(ProcessUser, "unknown")
| table _time, host, ProcessName, daemon_user, StorePath, EntryName, TargetPath
| sort -_time
```

### Microsoft KQL

```kql
GuixDaemonEvents
| where Timestamp > ago(24h)
| where EventType == "nar_extract"
| where EntryName has_any ("../", "..\\") or EntryName has "\u0000"
| project Timestamp, Computer, ProcessName, ProcessUser, StorePath, EntryName, TargetPath
| order by Timestamp desc
```

### Sigma

```yaml
title: Guix Substitute NAR Extraction Path Traversal Entry Name
id: 7a1e2c3d-4b5f-4e6a-9c1d-2f3a4b5c6d7e
status: experimental
description: Detects a NAR archive entry name containing path-traversal sequences during 'guix substitute' extraction, matching the restore-file extract-before-verify vulnerability (arbitrary file write, up to /etc/passwd as root).
references:
    - https://guix.gnu.org/en/blog/2026/guix-substitute-pull-vulnerabilities/
    - https://codeberg.org/guix/guix/pulls/9665
author: Threadlinqs Team
date: 2026-07-10
tags:
    - attack.initial-access
    - attack.t1195
    - attack.t1195.002
    - attack.privilege-escalation
    - attack.t1068
    - cve.pending.guix-2026
logsource:
    category: application
    product: guix
detection:
    selection:
        EventType: 'nar_extract'
        EntryName|contains:
            - '../'
            - '..\\'
    condition: selection
falsepositives:
    - None expected; legitimate NAR entry names never contain traversal sequences
level: high
```

**Known false positives:**

- Malformed but benign substitute-server responses during network corruption (rare; should not contain traversal sequences under normal operation)

**Tuning notes:** Scope to hosts running guix-daemon; if third-party substitute mirrors are permitted, allowlist their known-good store-path prefixes and alert only on traversal patterns, not benign path variance.

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

- [indicator] Substitute NAR Path Traversal Entry Name — Sentinel (Exploitation) (locked: unlock with TL Creds)
- [indicator] Root Process Writing to Sensitive System Files (Post-Exploitation Privilege Escalation) (locked: unlock with TL Creds)
- [indicator] file:// URI Symlink Dereference to /proc/*/fd (C2 / Lateral Local Info Disclosure) (locked: unlock with TL Creds)
- [indicator] Substitute Server Response Containing Path Traversal in NAR Entry Name (locked: unlock with TL Creds)
- [indicator] Narinfo Response Path Mismatch (Confused-Deputy Substitution) (locked: unlock with TL Creds)
- [indicator] Channel Cache Key Write Outside Intended Cache Directory (locked: unlock with TL Creds)
- [indicator] Substitute Write Outside /gnu/store Prefix (Post-Exploitation File Write) (locked: unlock with TL Creds)
- [indicator] Substitute Server Confused-Deputy / file:// URI Abuse (C2 / Lateral Data Exfiltration) (locked: unlock with TL Creds)

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

## Sample indicators (3 of 25)

Defanged, TLP:CLEAR.

- File hash: `897832f374dcdc9eeaf19d01e70b9a92fccfc68c`
- File hash: `ed0a9721f8a20d6ddcf6a0495302f502b3f7bb17`
- File hash: `2ef8ed9f0df53bddf14bdecc2ea48c2d233213cc`

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

## Sources

- ['guix substitute' and 'guix pull' Vulnerabilities — GNU Guix Blog](https://guix.gnu.org/en/blog/2026/guix-substitute-pull-vulnerabilities/)
- [#9665 - Fix vulnerabilities in guix substitute and guix pull](https://codeberg.org/guix/guix/pulls/9665)
- [GNU Guix vulnerabilities enable arbitrary file write and path traversal](https://cybersecuritynews.com/gnu-guix-vulnerabilities/)
- [Four vulnerabilities in Guix](https://lwn.net/Articles/1081199/)
- [GNU Guix Flaws Enable Remote Privilege Escalation and Store Corruption](https://cyberpress.org/gnu-guix-flaws-remote-privilege-escalation/)
- [GNU Guix Package Manager Hit by Four Security Flaws](https://linuxiac.com/gnu-guix-package-manager-hit-by-four-security-flaws/)
- [Four vulnerabilities in Guix — Noise](https://noise.getoto.net/2026/07/03/four-vulnerabilities-in-guix/)
- [GNU Guix: 'guix substitute' and 'guix pull' Vulnerabilities — Linux Consultant](https://www.linuxconsultant.org/gnu-guix-guix-substitute-and-guix-pull-vulnerabilities/)
- [Guix CVEs and Security Vulnerabilities — OpenCVE](https://app.opencve.io/cve/?vendor=gnu&product=guix)

## 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): https://intel.threadlinqs.com/mcp

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