# CVE-2026-5061: Consul-template vulnerable to sandbox path bypass in file helper via a symlink attack

> An attacker can bypass sandbox restrictions to read arbitrary files outside the intended directory using a symlink attack in the file helper.

- **Severity:** Medium 4.7 (`CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 12 May 2026
- **Updated:** 12 May 2026
- **Also known as:** BIT-consul-2026-5061, GHSA-m633-g3vp-7qw3

## What is CVE-2026-5061?

CVE-2026-5061 is a medium-severity path traversal vulnerability in HashiCorp Tooling, published on 12 May 2026. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

The consul-template library before version 0.42.0 is vulnerable to a sandbox path bypass in the file template helper that may allow reading an out-of-sandbox file. This vulnerability (CVE-2026-5061) is fixed in consul-template 0.42.0.

Weakness: CWE-59 (Improper Link Resolution Before File Access)

## Which versions are affected by CVE-2026-5061?

1 open source package ship an affected version, including consul.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `consul` | Bitnami | From 0.1.0 | 0.42.0 |

## How do I fix CVE-2026-5061?

Upgrade consul to 0.42.0 or later.

## Is CVE-2026-5061 being exploited?

There is no known exploitation of CVE-2026-5061 in the wild and no public exploit code.

Public exploit code:

- Consul Template validated where a symlink pointed during template evaluation, but its later dependency fetch read the original path. Retargeting the link between those operations turned an in-sandbox file reference into an out-of-sandbox file disclosure. (github_poc): https://github.com/0xmrma/CVE-2026-5061

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-5061 and fix it if it is affected.

What it is: CVE-2026-5061 is a medium-severity path traversal vulnerability in HashiCorp Tooling, published on 12 May 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-5061 in the wild and no public exploit code.

Affected packages and fixed versions:
- consul (Bitnami): affected from 0.1.0; fixed in 0.42.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-5061/ (Markdown: https://insights.sbomify.com/CVE-2026-5061/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-5061
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-5061
- OSV: https://osv.dev/vulnerability/CVE-2026-5061

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-5061/
Summaries are generated and may contain mistakes; the official description above is the record.
