Skip to content

Add HashiCorp Vault AppRole templated policy slash injection module (CVE-2026-5006) - #21849

Closed
M4xSec wants to merge 1 commit into
rapid7:masterfrom
M4xSec:vault-approle-slash-injection
Closed

Add HashiCorp Vault AppRole templated policy slash injection module (CVE-2026-5006)#21849
M4xSec wants to merge 1 commit into
rapid7:masterfrom
M4xSec:vault-approle-slash-injection

Conversation

@M4xSec

@M4xSec M4xSec commented Aug 30, 2026

Copy link
Copy Markdown

Summary

Auxiliary gather module for CVE-2026-5006 (HCSEC-2026-32). An AppRole granted a
templated read policy such as
secret/data/{{identity.entity.aliases.<accessor>.metadata.scope}}/* together with
the self-service capability to rotate its own secret-id can mint a secret-id whose
metadata.scope contains path separators. Vault <= 2.0.3 does not sanitize the /,
so the templated path traverses across segment boundaries and reads secrets outside
the credential's intended scope, without ever holding a root or admin token.

Fixed in Vault 2.0.4.

Verification

  • Start a Vault 2.0.3 instance provisioned per the module documentation
  • use auxiliary/gather/vault_approle_metadata_slash_injection
  • set RHOSTS, ROLE_ID, SECRET_ID
  • run
  • Confirm the out-of-scope secret is read and stored to loot

Tested against Vault 2.0.3.

Adds auxiliary/gather module for CVE-2026-5006 (HCSEC-2026-32). An AppRole
with a templated read policy such as
secret/data/{{identity.entity.aliases.<accessor>.metadata.scope}}/* plus the
self-service capability to rotate its own secret-id can mint a secret-id whose
metadata.scope contains path separators. Vault <= 2.0.3 does not sanitize the
'/', so the templated path traverses across segment boundaries and reads
secrets outside the credential's intended scope, with no root or admin token.

Tested against Vault 2.0.3.

Signed-off-by: venexy <predator0x300@gmail.com>
@M4xSec M4xSec closed this Aug 30, 2026
@M4xSec
M4xSec force-pushed the vault-approle-slash-injection branch from 24fa85e to 755c993 Compare August 30, 2026 22:42
@github-project-automation github-project-automation Bot moved this from Todo to Done in Metasploit Kanban Aug 30, 2026
@M4xSec

M4xSec commented Aug 30, 2026

Copy link
Copy Markdown
Author

Superseded by #21850. A force-push on this branch inadvertently closed this PR; #21850 carries the same module from the same branch, with a fix for the Lint/BareCheckCodeInNonExploit rubocop check (uses Exploit::CheckCode directly instead of a bare alias).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant