Description
The consul-template library before version 0.42.1 is vulnerable to a path redirection issue in the writeToFile template helper that may allow template output to be written outside the intended directory or to overwrite an existing file. This vulnerability (CVE-2026-14361) is fixed in consul-template 0.42.1.
Published: 2026-07-08
Score: 4.7 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The consul‑template library contains a path‑redirection flaw in the writeToFile template helper. An attacker who supplies a crafted template can cause the rendered output to be written to a location outside the intended directory or to overwrite an existing file. This flaw allows unintended file creation or modification and could compromise configuration files, logs, or other sensitive data. The weakness is classified as CWE‑59 and has a CVSS score of 4.7, indicating a moderate severity impact on confidentiality and integrity.

Affected Systems

All installations of HashiCorp consul‑template prior to version 0.42.1 are affected. The vulnerability is triggered when the writeToFile helper is used to persist template output to disk; applications that render templates to the filesystem must ensure that the target file path is not controlled by an attacker or does not contain symlinks. The fixed version is 0.42.1, which eliminates the path‑redirection behavior.

Risk and Exploitability

The CVSS score of 4.7 reflects moderate risk, while the EPSS score of less than 1% indicates a very low likelihood of exploitation, and the vulnerability is not in the CISA KEV catalog. Exploitation can be achieved by supplying a malicious template that references an absolute path or a symlink, and it requires the consul‑template process to run with sufficient privileges to write to the target location. Based on the description, it is inferred that the attack vector is the untrusted template input; mitigating privilege and input validation reduces the risk.

Generated by OpenCVE AI on July 28, 2026 at 09:08 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade consul‑template to version 0.42.1 or later to eliminate the path‑redirection flaw.
  • If an upgrade is not immediately possible, ensure that any template that uses the writeToFile helper originates from a trusted source or remove the helper from untrusted templates.
  • Run the consul‑template process under a least‑privilege user account and configure file system permissions so that the user cannot write beyond a designated safe output path, preventing unintended file writes.

Generated by OpenCVE AI on July 28, 2026 at 09:08 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Wed, 08 Jul 2026 21:45:00 +0000

Type Values Removed Values Added
First Time appeared Hashicorp
Hashicorp tooling
Vendors & Products Hashicorp
Hashicorp tooling

Wed, 08 Jul 2026 21:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Wed, 08 Jul 2026 20:15:00 +0000

Type Values Removed Values Added
Description The consul-template library before version 0.42.1 is vulnerable to a path redirection issue in the writeToFile template helper that may allow template output to be written outside the intended directory or to overwrite an existing file. This vulnerability (CVE-2026-14361) is fixed in consul-template 0.42.1.
Title Consul-template is vulnerable to path redirection in writeToFile through symlink attack
Weaknesses CWE-59
References
Metrics cvssV3_1

{'score': 4.7, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N'}


Subscriptions

Hashicorp Tooling
cve-icon MITRE

Status: PUBLISHED

Assigner: HashiCorp

Published:

Updated: 2026-07-08T20:37:56.570Z

Reserved: 2026-07-01T19:00:00.428Z

Link: CVE-2026-14361

cve-icon Vulnrichment

Updated: 2026-07-08T20:37:52.916Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-28T09:15:06Z

Weaknesses
  • CWE-59

    Improper Link Resolution Before File Access ('Link Following')