CVE-2022-40186: Github.com/hashicorp/vault HashiCorp Vault Vulnerable To Incorrect Vulnerability
CRITICALCVE-2022-40186 is a CRITICAL (CVSS 9.1) hashicorp vault vulnerable to incorrect vulnerability (CWE-639: Authorization Bypass Through User-Controlled Key) affecting Github.com/hashicorp/vault libraries in the Go ecosystem. The issue involves hashicorp vault vulnerable to incorrect metadata access. Remediation is available by upgrading affected packages to version 1.11.3, 1.10.6, 1.9.9.
CVE-2022-40186 at a Glance
Security Impact
CVSS: 9.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N).
How to Fix CVE-2022-40186
To remediate this vulnerability, upgrade all affected Github.com/hashicorp/vault dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/hashicorp/vault to 1.11.3
Upgrade github.com/hashicorp/vault to 1.10.6
Upgrade github.com/hashicorp/vault to 1.9.9
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/hashicorp/vault
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-40186, inspect your project dependencies for Github.com/hashicorp/vault:
inspect dependencies for github.com/hashicorp/vault
Analyze the terminal output to locate any version of Github.com/hashicorp/vault in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.11.3), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-639: Authorization Bypass Through User-Controlled Key, where the system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data. In Github.com/hashicorp/vault, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-40186 Affected Github.com/hashicorp/vault Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/hashicorp/vault
|
Go |
≥ 1.11.0
< 1.11.3
|
1.11.3
|
|
github.com/hashicorp/vault
|
Go |
≥ 1.10.0
< 1.10.6
|
1.10.6
|
|
github.com/hashicorp/vault
|
Go |
≥ 1.8.0
< 1.9.9
|
1.9.9
|
References
Frequently Asked Questions
What is CVE-2022-40186?
Which Github.com/hashicorp/vault versions are affected?
What version fixes CVE-2022-40186?
Is github.com/hashicorp/vault affected?
What is the CVSS score of CVE-2022-40186?
What CWE is associated with CVE-2022-40186?
How can I check Go dependencies for CVE-2022-40186?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7cgv-v83v-rr87",
"modified" : "2025-05-28T19:39:57Z",
"published" : "2022-09-23T00:00:46Z",
"aliases" : [ "CVE-2022-40186" ],
"summary" : "HashiCorp Vault vulnerable to incorrect metadata access",
"details" : "An issue was discovered in HashiCorp Vault and Vault Enterprise before 1.11.3. A vulnerability in the Identity Engine was found where, in a deployment where an entity has multiple mount accessors with shared alias names, Vault may overwrite metadata to the wrong alias due to an issue with checking the proper alias assigned to an entity. This may allow for unintended access to key/value paths using that metadata in Vault.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/hashicorp/vault"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.11.0"
}, {
"fixed" : "1.11.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/hashicorp/vault"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.10.0"
}, {
"fixed" : "1.10.6"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/hashicorp/vault"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.8.0"
}, {
"fixed" : "1.9.9"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-40186"
}, {
"type" : "WEB",
"url" : "https://discuss.hashicorp.com"
}, {
"type" : "WEB",
"url" : "https://discuss.hashicorp.com/t/hcsec-2022-18-vault-entity-alias-metadata-may-leak-between-aliases-with-the-same-name-assigned-to-the-same-entity/44550"
}, {
"type" : "WEB",
"url" : "https://github.com/hashicorp/vault"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20221111-0008"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-639" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2022-09-23T20:58:54Z",
"nvd_published_at" : "2022-09-22T01:15:00Z"
}
}