CVE-2021-31232: Github.com/cortexproject/cortex Improper Input Validation Vulnerability
MODERATECVE-2021-31232 is a MODERATE (CVSS 5.5) improper input validation vulnerability (CWE-20: Improper Input Validation) affecting Github.com/cortexproject/cortex libraries in the Go ecosystem. The issue involves improper input validation in cncf cortex. Remediation is available by upgrading affected packages to version 1.8.1.
CVE-2021-31232 at a Glance
Security Impact
CVSS: 5.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2021-31232
To remediate this vulnerability, upgrade all affected Github.com/cortexproject/cortex 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/cortexproject/cortex to 1.8.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/cortexproject/cortex
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-31232, inspect your project dependencies for Github.com/cortexproject/cortex:
inspect dependencies for github.com/cortexproject/cortex
Analyze the terminal output to locate any version of Github.com/cortexproject/cortex in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.8.1), 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Github.com/cortexproject/cortex, 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-2021-31232 Affected Github.com/cortexproject/cortex Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/cortexproject/cortex
|
Go |
< 1.8.1
|
1.8.1
|
References
Frequently Asked Questions
What is CVE-2021-31232?
Which Github.com/cortexproject/cortex versions are affected?
What version fixes CVE-2021-31232?
Is github.com/cortexproject/cortex affected?
What is the CVSS score of CVE-2021-31232?
What CWE is associated with CVE-2021-31232?
How can I check Go dependencies for CVE-2021-31232?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-m45g-f45x-vv22",
"modified" : "2021-05-20T21:19:40Z",
"published" : "2021-06-23T17:20:38Z",
"aliases" : [ "CVE-2021-31232" ],
"summary" : "Improper input validation in CNCF Cortex",
"details" : "The Alertmanager in CNCF Cortex before 1.8.1 has a local file disclosure vulnerability when -experimental.alertmanager.enable-api is used. The HTTP basic auth password_file can be used as an attack vector to send any file content via a webhook. The alertmanager templates can be used as an attack vector to send any file content because the alertmanager can load any text file specified in the templates list.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/cortexproject/cortex"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.8.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-31232"
}, {
"type" : "WEB",
"url" : "https://github.com/cortexproject/cortex/pull/4129/files"
}, {
"type" : "WEB",
"url" : "https://community.grafana.com/c/security-announcements"
}, {
"type" : "WEB",
"url" : "https://github.com/cortexproject/cortex"
}, {
"type" : "WEB",
"url" : "https://lists.cncf.io/g/cortex-users/message/50"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-05-20T21:19:40Z",
"nvd_published_at" : "2021-04-30T13:15:00Z"
}
}