CVE-2022-31670: Github.com/goharbor/harbor Harbor Fails To Validate The Vulnerability
HIGHCVE-2022-31670 is a HIGH (CVSS 7.7) harbor fails to validate the vulnerability (CWE-285: Improper Authorization) affecting Github.com/goharbor/harbor libraries in the Go ecosystem. The issue involves harbor fails to validate the user permissions when updating tag retention policies. Remediation is available by upgrading affected packages to version 1.10.13, 2.4.3, 2.5.2.
CVE-2022-31670 at a Glance
Security Impact
CVSS: 7.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:N).
How to Fix CVE-2022-31670
To remediate this vulnerability, upgrade all affected Github.com/goharbor/harbor 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/goharbor/harbor to 1.10.13
Upgrade github.com/goharbor/harbor to 2.4.3
Upgrade github.com/goharbor/harbor to 2.5.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/goharbor/harbor
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-31670, inspect your project dependencies for Github.com/goharbor/harbor:
inspect dependencies for github.com/goharbor/harbor
Analyze the terminal output to locate any version of Github.com/goharbor/harbor in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.10.13), 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-285: Improper Authorization, where the product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action. In Github.com/goharbor/harbor, 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-31670 Affected Github.com/goharbor/harbor Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/goharbor/harbor
|
Go |
≥ 1.0.0
< 1.10.13
|
1.10.13
|
|
github.com/goharbor/harbor
|
Go |
≥ 2.0.0
< 2.4.3
|
2.4.3
|
|
github.com/goharbor/harbor
|
Go |
≥ 2.5.0
< 2.5.2
|
2.5.2
|
References
Frequently Asked Questions
What is CVE-2022-31670?
Which Github.com/goharbor/harbor versions are affected?
What version fixes CVE-2022-31670?
Is github.com/goharbor/harbor affected?
What is the CVSS score of CVE-2022-31670?
What CWE is associated with CVE-2022-31670?
How can I check Go dependencies for CVE-2022-31670?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-3637-v6vq-xqqw",
"modified" : "2024-11-19T16:24:51Z",
"published" : "2022-09-16T19:29:31Z",
"aliases" : [ "CVE-2022-31670" ],
"summary" : "Harbor fails to validate the user permissions when updating tag retention policies",
"details" : "### Impact\n Harbor fails to validate the user permissions when updating tag retention policies. API call:\n\n PUT /retentions/{id}\n\nBy sending a request to update a tag retention policy with an id that belongs to a project\nthat the currently authenticated user doesn’t have access to, the attacker could modify\ntag retention policies configured in other projects.\n\n### Patches\nThis and similar issues are fixed in Harbor v2.5.2 and later. Please upgrade as soon as possible.\n\n### Workarounds\nThere are no workarounds available.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [the Harbor GitHub repository](https://github.com/goharbor/harbor)\n\n### Credits\nThanks to [Gal Goldstein](https://www.linkedin.com/in/gal-goldshtein/) and [Daniel Abeles](https://www.linkedin.com/in/daniel-abeles/) from [Oxeye Security](https://www.oxeye.io/) for reporting this issue.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/goharbor/harbor"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.0.0"
}, {
"fixed" : "1.10.13"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.10.12"
}
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/goharbor/harbor"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.4.3"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.4.2"
}
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/goharbor/harbor"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.5.0"
}, {
"fixed" : "2.5.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.5.1"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/goharbor/harbor/security/advisories/GHSA-3637-v6vq-xqqw"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-31670"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/goharbor/harbor"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-285", "CWE-863" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-09-16T19:29:31Z",
"nvd_published_at" : "2024-11-14T12:15:17Z"
}
}