CVE-2024-22244: Github.com/goharbor/harbor Open Redirect URL Vulnerability

MODERATE
Advisory Identifier: GHSA-5757-v49g-f6r7
CVSS 4.3
CWE-601
Published
Advisory Summary

CVE-2024-22244 is a MODERATE (CVSS 4.3) open redirect url vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Github.com/goharbor/harbor libraries in the Go ecosystem. The issue involves open redirect url in harbor. Remediation is available by upgrading affected packages to version 2.8.5, 2.9.3, 2.10.1.

CVE-2024-22244 at a Glance

CVE Identifier CVE-2024-22244
GHSA Identifier GHSA-5757-v49g-f6r7
Severity MODERATE
CVSS v3.1 Base Score 4.3
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product Github.com/goharbor/harbor
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 4.3

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

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

How to Fix CVE-2024-22244

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.8.5
Upgrade github.com/goharbor/harbor to 2.8.5
github.com/goharbor/harbor fixed: 2.9.3
Upgrade github.com/goharbor/harbor to 2.9.3
github.com/goharbor/harbor fixed: 2.10.1
Upgrade github.com/goharbor/harbor to 2.10.1
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-22244, 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.8.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-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. 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

### Description Under OIDC authentication mode, there is a redirect_url parameter exposed in the URL which is used to redirect the current user to the defined location after the successful OIDC login, This redirect_url can be an ambiguous URL and can be used to embed a phishing URL. For example: if a user clicks the URL with a malicious redirect_url: ``` https://<harbor_hostnmae>/c/oidc/login?redirect_url=https://<redirect_domain> ``` It might redirect the current user without their knowledge to a malicious site, posing a potential risk. To avoid this issue, the redirect_url should be checked if it is a local path when reading it from the original request URL. ``` //src/core/controllers/oidc.go ... redirectURL := oc.Ctx.Request.URL.Query().Get("redirect_url") if !utils.IsLocalPath(redirectURL) { log.Errorf("invalid redirect url: %v", redirectURL) oc.SendBadRequestError(fmt.Errorf("cannot redirect to other site")) return } if err := oc.SetSession(redirectURLKey, redirectURL); err != nil { ... ``` ### Impact When Harbor is configured with OIDC authentication and users log in via a link outside the Harbor server, it might be vulnerable to an open redirect attack. This attack only involves the OIDC Harbor user, if the current Harbor instance is not configured with OIDC auth, the redirect_url doesn't exist and the Harbor instance is not vulnerable to the open redirect attack. The following versions of Harbor are involved: <=Harbor 2.8.4, <=Harbor 2.9.2, <= Harbor 2.10.0 ### Patches Harbor 2.8.5, Harbor 2.9.3, Harbor 2.10.1 ### Workarounds When the Harbor is configured with OIDC authentication, warn the user not to log into the Harbor through external links. ### References N/A ### Credit Thanks Arnaud Cordier (arnaud@cordier.work)

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

3 component(s)
Fixed Versions:
2.8.52.9.32.10.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/goharbor/harbor
Go
< 2.8.5
2.8.5
github.com/goharbor/harbor
Go
≥ 2.9.0
< 2.9.3
2.9.3
github.com/goharbor/harbor
Go
≥ 2.10.0
< 2.10.1
2.10.1

References

Frequently Asked Questions

What is CVE-2024-22244?
CVE-2024-22244 is a security vulnerability in Github.com/goharbor/harbor involving Open Redirect URL in Harbor under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which Github.com/goharbor/harbor versions are affected?
Affected versions include releases prior to 2.8.5, 2.9.3, 2.10.1 across affected packages: github.com/goharbor/harbor.
What version fixes CVE-2024-22244?
Upgrading to 2.8.5, 2.9.3, 2.10.1 (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.8.5, 2.9.3, 2.10.1. Upgrade your dependency to 2.8.5, 2.9.3, 2.10.1 or later.
What is the CVSS score of CVE-2024-22244?
CVE-2024-22244 has a CVSS v3.1 base score of 4.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2024-22244?
CVE-2024-22244 is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check Go dependencies for CVE-2024-22244?
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-5757-v49g-f6r7",
  "modified" : "2025-02-26T22:18:08Z",
  "published" : "2024-06-02T22:32:32Z",
  "aliases" : [ "CVE-2024-22244" ],
  "summary" : "Open Redirect URL in Harbor",
  "details" : "### Description\nUnder OIDC authentication mode, there is a redirect_url parameter exposed in the URL which is used to redirect the current user to the defined location after the successful OIDC login, This redirect_url can be an ambiguous URL and can be used to embed a phishing URL.\nFor example: if a user clicks the URL with a malicious redirect_url:\n```\nhttps://<harbor_hostnmae>/c/oidc/login?redirect_url=https://<redirect_domain>\n```\nIt might redirect the current user without their knowledge to a malicious site, posing a potential risk.\nTo avoid this issue, the redirect_url should be checked if it is a local path when reading it from the original request URL. \n```\n//src/core/controllers/oidc.go\n...\nredirectURL := oc.Ctx.Request.URL.Query().Get(\"redirect_url\")\nif !utils.IsLocalPath(redirectURL) {\n    log.Errorf(\"invalid redirect url: %v\", redirectURL)\n    oc.SendBadRequestError(fmt.Errorf(\"cannot redirect to other site\"))\n    return\n}\nif err := oc.SetSession(redirectURLKey, redirectURL); err != nil {\n...\n```\n### Impact\nWhen Harbor is configured with OIDC authentication and users log in via a link outside the Harbor server, it might be vulnerable to an open redirect attack. This attack only involves the OIDC Harbor user, if the current Harbor instance is not configured with OIDC auth, the redirect_url doesn't exist and the Harbor instance is not vulnerable to the open redirect attack.\n\nThe following versions of Harbor are involved:\n<=Harbor 2.8.4, <=Harbor 2.9.2, <= Harbor 2.10.0\n\n### Patches\nHarbor 2.8.5, Harbor 2.9.3, Harbor 2.10.1\n\n### Workarounds\nWhen the Harbor is configured with OIDC authentication, warn the user not to log into the Harbor through external links.\n\n### References\nN/A\n\n### Credit\nThanks Arnaud Cordier (arnaud@cordier.work)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/goharbor/harbor"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.8.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/goharbor/harbor"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.9.0"
      }, {
        "fixed" : "2.9.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/goharbor/harbor"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.10.0"
      }, {
        "fixed" : "2.10.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/goharbor/harbor/security/advisories/GHSA-5757-v49g-f6r7"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-22244"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/goharbor/harbor"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2024-2915"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-06-02T22:32:32Z",
    "nvd_published_at" : "2024-06-10T23:15:49Z"
  }
}