CVE-2024-22278: Github.com/goharbor/harbor Harbor Fails To Validate The Vulnerability

HIGH
Advisory Identifier: GHSA-hw28-333w-qxp3
CVSS 5.5
CWE-269
Published
Advisory Summary

CVE-2024-22278 is a HIGH (CVSS 5.5) harbor fails to validate the vulnerability (CWE-269: Improper Privilege Management) affecting Github.com/goharbor/harbor libraries in the Go ecosystem. The issue involves harbor fails to validate the user permissions when updating project configurations. Remediation is available by upgrading affected packages to version 2.9.5, 2.10.3.

CVE-2024-22278 at a Glance

CVE Identifier CVE-2024-22278
GHSA Identifier GHSA-hw28-333w-qxp3
Severity HIGH
CVSS v3.1 Base Score 5.5
CWE Classification CWE-269: Improper Privilege Management
Affected Product Github.com/goharbor/harbor
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N).

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

How to Fix CVE-2024-22278

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: 2.9.5
Upgrade github.com/goharbor/harbor to 2.9.5
github.com/goharbor/harbor fixed: 2.10.3
Upgrade github.com/goharbor/harbor to 2.10.3
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-2024-22278, 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 2.9.5), 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-269: Improper Privilege Management, where the product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor. 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 maintainer role permissions when creating/updating/deleting project configurations - API call: - PUT /projects/{project_name_or_id}/metadatas/{meta_name} - POST /projects/{project_name_or_id}/metadatas/{meta_name} - DELETE /projects/{project_name_or_id}/metadatas/{meta_name} By sending a request to create/update/delete a metadata with an name that belongs to a project that the currently authenticated and granted to the maintainer role user doesn’t have access to, the attacker could modify configurations in the current project. BTW: the maintainer role in Harbor was intended for individuals who closely support the project admin in maintaining the project but lack configuration management permissions. However, the maintainer role can utilize the metadata API to circumvent this limitation. It's important to note that any potential attacker must be authenticated and granted a specific project maintainer role to modify configurations, limiting their scope to only that project. ### Patches Will be fixed in v2.9.5, v2.10.3 and v2.11.0 ### Workarounds There are no workarounds available. ### Credit Thanks to Ravid Mazon(rmazon@paloaltonetworks.com), Jay Chen (jaychen@paloaltonetworks.com) Palo Alto Networks for reporting this issue.

CVE-2024-22278 Affected Github.com/goharbor/harbor Versions

2 component(s)
Fixed Versions:
2.9.52.10.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/goharbor/harbor
Go
< 2.9.5
2.9.5
github.com/goharbor/harbor
Go
≥ 2.10.0
< 2.10.3
2.10.3

References

Frequently Asked Questions

What is CVE-2024-22278?
CVE-2024-22278 is a security vulnerability in Github.com/goharbor/harbor involving Harbor fails to validate the user permissions when updating project configurations under CWE-269: Improper Privilege Management.
Which Github.com/goharbor/harbor versions are affected?
Affected versions include releases prior to 2.9.5, 2.10.3 across affected packages: github.com/goharbor/harbor.
What version fixes CVE-2024-22278?
Upgrading to 2.9.5, 2.10.3 (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 2.9.5, 2.10.3. Upgrade your dependency to 2.9.5, 2.10.3 or later.
What is the CVSS score of CVE-2024-22278?
CVE-2024-22278 has a CVSS v3.1 base score of 5.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2024-22278?
CVE-2024-22278 is classified under CWE-269: Improper Privilege Management (The product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor.).
How can I check Go dependencies for CVE-2024-22278?
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-hw28-333w-qxp3",
  "modified" : "2024-11-18T16:26:57Z",
  "published" : "2024-07-31T16:53:13Z",
  "aliases" : [ "CVE-2024-22278" ],
  "summary" : "Harbor fails to validate the user permissions when updating project configurations",
  "details" : "### Impact\nHarbor fails to validate the maintainer role permissions when creating/updating/deleting project configurations - API call:\n\n- PUT /projects/{project_name_or_id}/metadatas/{meta_name}\n- POST /projects/{project_name_or_id}/metadatas/{meta_name}\n- DELETE /projects/{project_name_or_id}/metadatas/{meta_name}\n\nBy sending a request to create/update/delete a metadata with an name that belongs to a project that the currently authenticated and granted to the maintainer role user doesn’t have access to, the attacker could modify configurations in the current project.\n\nBTW: the maintainer role in Harbor was intended for individuals who closely support the project admin in maintaining the project but lack configuration management permissions. However, the maintainer role can utilize the metadata API to circumvent this limitation. It's important to note that any potential attacker must be authenticated and granted a specific project maintainer role to modify configurations, limiting their scope to only that project.\n\n\n### Patches\nWill be fixed in v2.9.5, v2.10.3 and v2.11.0\n\n### Workarounds\nThere are no workarounds available.\n\n### Credit\nThanks to Ravid Mazon(rmazon@paloaltonetworks.com), Jay Chen (jaychen@paloaltonetworks.com) Palo Alto Networks for reporting this issue.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:L/VI:L/VA:H/SC:L/SI:L/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/goharbor/harbor"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.9.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/goharbor/harbor"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.10.0"
      }, {
        "fixed" : "2.10.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/goharbor/harbor/security/advisories/GHSA-hw28-333w-qxp3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-22278"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/goharbor/harbor"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2024-3013"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-269" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-07-31T16:53:13Z",
    "nvd_published_at" : "2024-08-02T01:15:23Z"
  }
}