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

MODERATE
Advisory Identifier: GHSA-xx9w-464f-7h6f
CVSS 6.4
CWE-285 CWE-863
Published
Advisory Summary

CVE-2022-31667 is a MODERATE (CVSS 6.4) 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 a robot account. Remediation is available by upgrading affected packages to version 1.10.13, 2.4.3, 2.5.2.

CVE-2022-31667 at a Glance

CVE Identifier CVE-2022-31667
GHSA Identifier GHSA-xx9w-464f-7h6f
Severity MODERATE
CVSS v3.1 Base Score 6.4
CWE Classification CWE-285: Improper Authorization
Affected Product Github.com/goharbor/harbor
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.4

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:L/A:L).

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 None (C:N)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2022-31667

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-31667, 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 when updating a robot account that belongs to a project that the authenticated user doesn’t have access to. API call: PUT /robots/{robot_id} By sending a request that attempts to update a robot account, and specifying a robot account id and robot account name that belongs to a different project that the user doesn’t have access to, it was possible to revoke the robot account permissions. ### 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-31667 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-31667?
CVE-2022-31667 is a security vulnerability in Github.com/goharbor/harbor involving Harbor fails to validate the user permissions when updating a robot account 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-31667?
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-31667?
CVE-2022-31667 has a CVSS v3.1 base score of 6.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:L.
What CWE is associated with CVE-2022-31667?
CVE-2022-31667 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-31667?
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-xx9w-464f-7h6f",
  "modified" : "2024-11-19T16:25:22Z",
  "published" : "2022-09-16T20:27:13Z",
  "aliases" : [ "CVE-2022-31667" ],
  "summary" : " Harbor fails to validate the user permissions when updating a robot account",
  "details" : "### Impact\nHarbor fails to validate the user permissions when updating a robot account that\nbelongs to a project that the authenticated user doesn’t have access to. API call:\n\nPUT /robots/{robot_id}\n\nBy sending a request that attempts to update a robot account, and specifying a robot\naccount id and robot account name that belongs to a different project that the user\ndoesn’t have access to, it was possible to revoke the robot account permissions.\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:L/A:L"
  } ],
  "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-xx9w-464f-7h6f"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-31667"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/goharbor/harbor"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-285", "CWE-863" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-09-16T20:27:13Z",
    "nvd_published_at" : "2024-11-14T12:15:16Z"
  }
}