
Audit and educational toolkit for CVE-2026-5006, a Vault templated-policy slash-injection vulnerability. Includes a read-only audit script generating Markdown reports and an interactive walkthrough for remediation.
Two tools for working through the Vault templated-policy slash-injection vulnerability: an interactive walkthrough for explaining and scoping the issue, and an audit script that checks a live cluster and writes the findings to Markdown.
vault-cve-2026-5006-walkthrough.html - interactive, self-contained walkthrough of the issuevault-cve-2026-5006-audit.sh - read-only cluster audit that generates four reportsA Vault policy path can pull in a live identity value, such as a user's
department, through templating. Vault fills that value into one path segment
when it renders the policy. Nothing stops the value from carrying a slash, and
a slash is a path separator, so a value like admin/super-secret turns one
intended segment into two and grants access the policy author never wrote.
Exploiting it needs three things to line up: an authenticated attacker, a
templated policy, and control over the identity value that feeds it (entity
metadata, an alias name, custom metadata, or group metadata).
The fix has two halves: upgrade to a patched build, then set
deny_slash_in_templated_paths = true in the server config and restart. The
flag defaults to off, so upgrading alone does not close the gap.
| Edition | Affected | Fixed in |
|---|---|---|
| Community | 0.11.0 through 2.0.3 | 2.0.4 |
| Enterprise | 0.11.0 through 2.0.3 | 2.0.4 |
| Enterprise LTS | up to 1.21.8 / 1.20.13 / 1.19.19 | 1.21.9 / 1.20.14 / 1.19.20 |
vault-cve-2026-5006-walkthrough.html)A single self-contained HTML file. Open it in any browser.
deny_slash_in_templated_paths
on and off so you can see the fix blocking the rule in real time.helm upgrade, the ordered
pod cycling (standbys first, active last), and verification.Platform or security teams. Start with the attack tab to gain context of the issue, use the check tab to hand off the commands, and switch the remediate tab to whichever deployment they run.
vault-cve-2026-5006-audit.sh)Walks every namespace you can reach and writes four Markdown reports. It never modifies Vault; every call is a list or a read.
vault CLI and jq on your PATHVAULT_ADDR set to the cluster addressVAULT_TOKEN in the environment or a prior
vault login. On HCP, a token scoped to your admin namespace.# HCP Vault Dedicated (default start namespace is "admin")
./vault-cve-2026-5006-audit.sh
# Self-managed with a root token: start at the true root
./vault-cve-2026-5006-audit.sh -n ""
# Start from a specific subtree and choose an output directory
./vault-cve-2026-5006-audit.sh -n admin/team-a -o ./team-a-audit
| Flag | Meaning | Default |
|---|---|---|
-n | Namespace the walk starts from | admin |
-o | Output directory for the Markdown files | ./vault-audit |
-h | Print the usage header and exit |
Start at admin on HCP because the true root namespace is not visible to you
there. Use -n "" only when you hold a root token on a self-managed cluster.
| File | Contents |
|---|---|
policies.md | Templated policies grouped by namespace, with the HCL |
entity-metadata.md | Entity names and metadata, one table per namespace |
alias-and-custom-metadata.md | Alias names and custom metadata, per namespace |
group-metadata.md | Group names and metadata, per namespace |
Each file opens with the advisory reference, a UTC timestamp, the cluster address, the start namespace, and the number of namespaces scanned.
policies.md lists only policies whose path is rendered from identity data
(a {{identity...}} reference). Those are the ones that can be widened by a
slash.
The three identity reports add a Slash? column. A row is flagged when the
name or any metadata value contains a /. Checking the name matters: an alias
named admin/injected is an exposure even when its metadata is clean, because
the name itself can feed a template.
A flag marks exposure surface, not proof of compromise. For each one, confirm who is allowed to write that value and restructure the policy where a slash would widen scope.
Vault Enterprise and HCP isolate both policies and the identity store per
namespace, so the script runs every check in each namespace. vault namespace list returns only direct children as partial paths, so the script recurses and
rebuilds each full path as it descends, then sets VAULT_NAMESPACE for every
call.
On deep namespace trees this makes a lot of API calls and can run slowly. Point
-n at a subtree for a fast first pass before scanning everything.
deny_slash_in_templated_paths = true and restart each server. On
HCP this is a support request, since the server config is not yours to edit.
On self-managed you set it yourself.The walkthrough's remediate tab has the step-by-step for both HCP and Kubernetes.
deny_slash_in_templated_paths in the Vault configuration referenceThese tools are an aid, not an official HashiCorp statement.