CVE-2022-31666: Github.com/goharbor/harbor Harbor Fails To Validate The Vulnerability

HIGH
Advisory Identifier: GHSA-jf8p-3vjh-pq94
CVSS 7.7
CWE-285
Published
Advisory Summary

CVE-2022-31666 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 viewing webhook policies. Remediation is available by upgrading affected packages to version 1.10.13, 2.4.3, 2.5.2.

CVE-2022-31666 at a Glance

CVE Identifier CVE-2022-31666
GHSA Identifier GHSA-jf8p-3vjh-pq94
Severity HIGH
CVSS v3.1 Base Score 7.7
CWE Classification CWE-285: Improper Authorization
Affected Product Github.com/goharbor/harbor
Package Ecosystem Go
Published Date
Last Updated

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:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2022-31666

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.

github.com/goharbor/harbor fixed: 1.10.13
Upgrade github.com/goharbor/harbor to 1.10.13
github.com/goharbor/harbor fixed: 2.4.3
Upgrade github.com/goharbor/harbor to 2.4.3
github.com/goharbor/harbor fixed: 2.5.2
Upgrade github.com/goharbor/harbor to 2.5.2
Verify Direct and Transitive Dependencies

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-31666, 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

### Impact Harbor fails to validate the user permissions to view Webhook policies including relevant credentials configured in different projects the user doesn’t have access to, resulting in malicious users being able to read Webhook policies of other users/projects. API call is   GET /projects/{project_name_or_id}/webhook/policies/{webhook_policy_id} By sending the below request and specifying different Webhook policy ids in the last part of the URL, the malicious user may disclose Webhook policies related to other repositories/projects.: none;"> ### Patches This and similar issues are fixed in Harbor v2.5.2 and later. Please upgrade as soon as possible. ### Workarounds There are no workarounds available. ### For more information If you have any questions or comments about this advisory: * Open an issue in [the Harbor GitHub repository](https://github.com/goharbor/harbor) ### Credits Thanks 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.

CVE-2022-31666 Affected Github.com/goharbor/harbor Versions

3 component(s)
Fixed Versions:
1.10.132.4.32.5.2
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-31666?
CVE-2022-31666 is a security vulnerability in Github.com/goharbor/harbor involving Harbor fails to validate the user permissions when viewing Webhook policies under CWE-285: Improper Authorization.
Which Github.com/goharbor/harbor versions are affected?
Affected versions include releases prior to 1.10.13, 2.4.3, 2.5.2 across affected packages: github.com/goharbor/harbor.
What version fixes CVE-2022-31666?
Upgrading to 1.10.13, 2.4.3, 2.5.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/goharbor/harbor affected?
Yes, github.com/goharbor/harbor is affected in releases prior to 1.10.13, 2.4.3, 2.5.2. Upgrade your dependency to 1.10.13, 2.4.3, 2.5.2 or later.
What is the CVSS score of CVE-2022-31666?
CVE-2022-31666 has a CVSS v3.1 base score of 7.7 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2022-31666?
CVE-2022-31666 is classified under CWE-285: Improper Authorization (The product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.).
How can I check Go dependencies for CVE-2022-31666?
Run the dependency tree command: 'inspect dependencies for github.com/goharbor/harbor'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-jf8p-3vjh-pq94",
  "modified" : "2024-11-14T17:53:34Z",
  "published" : "2022-09-16T19:35:47Z",
  "aliases" : [ "CVE-2022-31666" ],
  "summary" : "Harbor fails to validate the user permissions when viewing Webhook policies",
  "details" : "### Impact\nHarbor fails to validate the user permissions to view Webhook policies including relevant credentials configured in different projects the user doesn’t have access to, resulting in malicious users being able to read Webhook policies of other users/projects. API call is\n\n  GET /projects/{project_name_or_id}/webhook/policies/{webhook_policy_id}\n\nBy sending the below request and specifying different Webhook policy ids in the last part of the URL, the malicious user may disclose Webhook policies related to other repositories/projects.: none;\">\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:H/I:N/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-8hwq-5f22-jfr3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/goharbor/harbor/security/advisories/GHSA-jf8p-3vjh-pq94"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-31666"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/goharbor/harbor"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-285" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-09-16T19:35:47Z",
    "nvd_published_at" : "2024-11-14T12:15:16Z"
  }
}