CVE-2024-22261

CVE-2024-22261 is a low-severity security vulnerability in github.com/goharbor/harbor (go), affecting versions < 2.8.6. It is fixed in 2.8.6, 2.9.4, 2.10.2.

Summary

Workarounds

There is no workaround for this issue.

Credits

Thanks Taisei Inoue ([email protected])

Impact

A user with an administrator, project_admin, or project_maintainer role could utilize and exploit SQL Injection to allow the execution of any Postgres function or the extraction of sensitive information from the database through this API:

GET /api/v2.0/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/scan/{report_id}/log

The SQL injection might happen in the code:

https://github.com/goharbor/harbor/blob/9b7c1a2274fbc5ea16e19a484532f86c08926577/src/pkg/task/task.go#L241

Because raw SQL executed in ormer.Raw(Sql).QueryRows() is PrepareStatement. In the driver of Postgres, one PrepareStatement must contain only ONE SQL command, see https://www.postgresql.org/docs/15/libpq-exec.html#LIBPQ-PQPREPARE. The SQL should start with:

SELECT * FROM task WHERE extra_attrs::jsonb->'report_uuids' @>

Adding a delete/update operation by appending malicious content to the current SQL is impossible. Furthermore, the query result of the task is just an intermediate result, the task ID is used to locate the job log file, and the response only contains the content of the job log file. so this vulnerability can be used to execute SQL functions, but it can't leak any useful information to the response.

Harbor >=v2.8.1, >=2.9.0, >=2.10.0 are impacted.

CVE-2024-22261 has a CVSS score of 2.7 (Low). The vector is network-reachable, high privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.8.6, 2.9.4, 2.10.2); upgrading removes the vulnerable code path.

Affected versions

github.com/goharbor/harbor (< 2.8.6) github.com/goharbor/harbor (>= 2.9.0, < 2.9.4) github.com/goharbor/harbor (>= 2.10.0, < 2.10.2)

Security releases

github.com/goharbor/harbor → 2.8.6 (go) github.com/goharbor/harbor → 2.9.4 (go) github.com/goharbor/harbor → 2.10.2 (go)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

Harbor v2.8.6, v2.9.4, v2.10.2 fixes this issue.

Frequently Asked Questions

  1. What is CVE-2024-22261? CVE-2024-22261 is a low-severity security vulnerability in github.com/goharbor/harbor (go), affecting versions < 2.8.6. It is fixed in 2.8.6, 2.9.4, 2.10.2.
  2. How severe is CVE-2024-22261? CVE-2024-22261 has a CVSS score of 2.7 (Low). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of github.com/goharbor/harbor are affected by CVE-2024-22261? github.com/goharbor/harbor (go) versions < 2.8.6 is affected.
  4. Is there a fix for CVE-2024-22261? Yes. CVE-2024-22261 is fixed in 2.8.6, 2.9.4, 2.10.2. Upgrade to this version or later.
  5. Is CVE-2024-22261 exploitable, and should I be worried? Whether CVE-2024-22261 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2024-22261 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2024-22261?
    • Upgrade github.com/goharbor/harbor to 2.8.6 or later
    • Upgrade github.com/goharbor/harbor to 2.9.4 or later
    • Upgrade github.com/goharbor/harbor to 2.10.2 or later

Other vulnerabilities in github.com/goharbor/harbor

CVE-2025-30086CVE-2025-32019CVE-2022-31668CVE-2024-22278CVE-2024-22261

Stop the waste.
Protect your environment with Kodem.