This product is not supported for your selected Datadog site. ().

Metadata

Id: terraform-vault-pki-acme-sign-verbatim-unsafe-default-directory-policy

Platform: Terraform

Severity: Medium

Category: Insecure Defaults

Learn More

Description

The vault_pki_secret_backend_config_acme resource enables Vault’s PKI secrets engine ACME server with default_directory_policy set to sign-verbatim-unsafe. This value explicitly opts in to the behavior fixed by HCSEC-2026-40 / CVE-2026-105818: Vault copies subject alternative name types that the ACME protocol never validates (anything other than DNS names and IP addresses, such as email addresses, URIs, or other names) from the certificate signing request into the issued certificate. An ACME client that completes validation for an identifier it controls can therefore obtain a certificate that also asserts other, unverified identities, enabling impersonation toward systems that trust the Vault PKI mount. To remediate, set default_directory_policy to sign-verbatim, which rejects these requests on fixed Vault versions, or to forbid or a role:<role> whose constraints exclude unverified subject alternative name types.

Compliant Code Examples

resource "vault_pki_secret_backend_config_acme" "negative1" {
  backend                  = vault_mount.pki.path
  enabled                  = true
  default_directory_policy = "forbid"
}
resource "vault_pki_secret_backend_config_acme" "negative2" {
  backend                  = vault_mount.pki.path
  enabled                  = true
  default_directory_policy = "role:acme-restricted"
  allowed_roles            = ["acme-restricted"]
}
resource "vault_pki_secret_backend_config_acme" "negative3" {
  backend = vault_mount.pki.path
  enabled = false
}

Non-Compliant Code Examples

resource "vault_pki_secret_backend_config_acme" "positive1" {
  backend                  = vault_mount.pki.path
  enabled                  = true
  default_directory_policy = "sign-verbatim-unsafe"
}