{"id":"CVE-2024-22261","aliases":["BIT-harbor-2024-22261","EUVD-2024-2184","GHSA-vw63-824v-qf2j","GO-2024-2916"],"status":"published","title":"SQL Injection in Harbor scan log API","description":"SQL-Injection in Harbor allows priviledge users to leak the task IDs","severity":{"version":"3.1","score":2.7,"vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N","level":"low","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.00417,"percentile":0.36297,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-566","CWE-89"],"published":"2024-06-02T22:32:40Z","modified":"2026-10-28T02:30:36Z","fixes":[{"ecosystem":"Go","package":"github.com/goharbor/harbor","fixed_in":["2.8.6","2.9.4","2.10.2","2.8.6+incompatible","2.9.4+incompatible","2.10.2+incompatible"],"sources":["ghsa","osv"]},{"ecosystem":"Bitnami","package":"harbor","fixed_in":["2.8.6","2.9.4","2.10.2"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"Go","package":"github.com/goharbor/harbor","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.8.6"}]}]},{"source":"ghsa","ecosystem":"Go","package":"github.com/goharbor/harbor","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.9.0"},{"fixed":"2.9.4"}]}]},{"source":"ghsa","ecosystem":"Go","package":"github.com/goharbor/harbor","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.10.0"},{"fixed":"2.10.2"}]}]},{"source":"osv","ecosystem":"Bitnami","package":"harbor","ranges":[{"type":"SEMVER","events":[{"introduced":"2.8.1"},{"fixed":"2.8.6"},{"introduced":"2.9.0"},{"fixed":"2.9.4"},{"introduced":"2.10.0"},{"fixed":"2.10.2"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/goharbor/harbor","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.8.6"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/goharbor/harbor","ranges":[{"type":"SEMVER","events":[{"introduced":"2.9.0"},{"fixed":"2.9.4"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/goharbor/harbor","ranges":[{"type":"SEMVER","events":[{"introduced":"2.10.0"},{"fixed":"2.10.2"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/goharbor/harbor","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.8.6+incompatible"},{"introduced":"2.9.0+incompatible"},{"fixed":"2.9.4+incompatible"},{"introduced":"2.10.0+incompatible"},{"fixed":"2.10.2+incompatible"}]}]}],"products":[{"vendor":"harbor","product":"harbor"},{"vendor":"linuxfoundation","product":"harbor"}],"references":[{"url":"https://github.com/goharbor/harbor/security/advisories/GHSA-vw63-824v-qf2j","tags":["x_transferred","Vendor Advisory","advisory","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-22261","tags":["web","advisory"]},{"url":"https://pkg.go.dev/vuln/GO-2024-2916","tags":["web"]},{"url":"https://github.com/advisories/GHSA-vw63-824v-qf2j"},{"url":"https://github.com/goharbor","tags":["web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/22xxx/CVE-2024-22261.json","tags":["advisory"]},{"url":"https://github.com/goharbor/harbor","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2024-22261","title":"SQL Injection in Harbor scan log API","description":"SQL-Injection in Harbor allows priviledge users to leak the task IDs","status":"published","published":"2024-06-10T23:25:32.158Z","modified":"2024-08-01T22:43:34.096Z","cvss":[{"version":"3.1","score":2.7,"vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N","level":"low","assessor":"cna"}],"cwes":["CWE-566"],"updated_at":"2026-11-02T14:33:59.884489Z"}],"euvd":[{"id":"EUVD-2024-2184","description":"SQL-Injection in Harbor allows priviledge users to leak the task IDs","status":"published","published":"2024-06-10T23:25:32Z","modified":"2024-08-01T22:43:34Z","cvss":[{"version":"3.1","score":2.7,"vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N","level":"low"}],"updated_at":"2026-11-03T03:50:29.401303Z"}],"ghsa":[{"id":"GHSA-vw63-824v-qf2j","title":"SQL Injection in Harbor scan log API","description":"### Impact\n\nA 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:\n```\nGET /api/v2.0/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/scan/{report_id}/log\n```\nThe SQL injection might happen in the code: \n\nhttps://github.com/goharbor/harbor/blob/9b7c1a2274fbc5ea16e19a484532f86c08926577/src/pkg/task/task.go#L241\n\nBecause 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:\n```\nSELECT * FROM task WHERE extra_attrs::jsonb-\u003e'report_uuids' @\u003e\n```\nAdding 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.\n\nHarbor \u003e=v2.8.1, \u003e=2.9.0, \u003e=2.10.0 are impacted.\n\n### Patches\nHarbor v2.8.6, v2.9.4, v2.10.2 fixes this issue.\n\n### Workarounds\nThere is no workaround for this issue.\n\n### Credits\n\nThanks Taisei Inoue ([taisei.inoue@gmo-cybersecurity.com](mailto:taisei.inoue@gmo-cybersecurity.com))","status":"published","published":"2024-06-02T22:32:40Z","modified":"2024-06-17T15:14:42Z","cvss":[{"version":"3.1","score":2.7,"vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N","level":"low"}],"cwes":["CWE-566"],"updated_at":"2026-11-02T14:37:54.624184Z"}],"nvd":[{"id":"CVE-2024-22261","description":"SQL-Injection in Harbor allows priviledge users to leak the task IDs","status":"published","published":"2024-06-11T00:15:13.79Z","modified":"2026-06-17T07:11:03.337Z","cvss":[{"version":"3.1","score":2.7,"vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N","level":"low","assessor":"secondary"},{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:L/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-566","CWE-89"],"updated_at":"2026-11-02T14:10:04.804473Z"}],"osv":[{"id":"CVE-2024-22261","title":"SQL Injection in Harbor scan log API","description":"SQL-Injection in Harbor allows priviledge users to leak the task IDs","status":"published","published":"2024-06-10T23:25:32.158Z","modified":"2026-10-28T02:30:36.609146476Z","cvss":[{"version":"3.1","score":2.7,"vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N","level":"low"}],"cwes":["CWE-566"],"updated_at":"2026-11-02T15:44:38.577405Z"},{"id":"GHSA-vw63-824v-qf2j","title":"SQL Injection in Harbor scan log API","description":"### Impact\n\nA 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:\n```\nGET /api/v2.0/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/scan/{report_id}/log\n```\nThe SQL injection might happen in the code: \n\nhttps://github.com/goharbor/harbor/blob/9b7c1a2274fbc5ea16e19a484532f86c08926577/src/pkg/task/task.go#L241\n\nBecause 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:\n```\nSELECT * FROM task WHERE extra_attrs::jsonb-\u003e'report_uuids' @\u003e\n```\nAdding 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.\n\nHarbor \u003e=v2.8.1, \u003e=2.9.0, \u003e=2.10.0 are impacted.\n\n### Patches\nHarbor v2.8.6, v2.9.4, v2.10.2 fixes this issue.\n\n### Workarounds\nThere is no workaround for this issue.\n\n### Credits\n\nThanks Taisei Inoue ([taisei.inoue@gmo-cybersecurity.com](mailto:taisei.inoue@gmo-cybersecurity.com))","status":"published","published":"2024-06-02T22:32:40Z","modified":"2026-07-08T06:53:07.766703212Z","cvss":[{"version":"3.1","score":2.7,"vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N","level":"low"}],"cwes":["CWE-566"],"updated_at":"2026-11-02T15:46:57.694388Z"},{"id":"BIT-harbor-2024-22261","title":"SQL Injection in Harbor scan log API","description":"SQL-Injection in Harbor allows priviledge users to leak the task IDs","status":"published","published":"2026-01-26T14:40:06.365Z","modified":"2026-09-08T08:47:51.674459813Z","updated_at":"2026-11-02T15:28:31.02759Z"},{"id":"GO-2024-2916","title":"SQL Injection in Harbor scan log API in github.com/goharbor/harbor","description":"SQL Injection in Harbor scan log API in github.com/goharbor/harbor","status":"published","published":"2024-06-14T13:41:08Z","modified":"2026-03-03T04:55:27.620474Z","updated_at":"2026-11-02T15:47:01.453823Z"}]}}
