CVE-2022-31671 is an authorization flaw in Harbor that lets an authenticated user read job logs from P2P preheat executions in projects they cannot access. NVD scores it 7.4 High, while Harbor's own advisory rates it 5.0 Moderate. Upgrade to 2.4.3 or 2.5.2 or later.
What's affected
Two Harbor advisories are linked from the record. GHSA-q76q-q8hw-hmpw, published 29 August 2022, covers reading job execution logs through the P2P preheat execution logs. It lists Harbor 2.x up to 2.4.2 and 2.5 up to 2.5.1 as affected and 2.4.3 and 2.5.2 as patched, with no workaround. The second, GHSA-3wpx-625q-22j7, is the preheat policy advisory also tied to CVE-2022-31668.
Severity differs. NVD scores this CVE 7.4 High, apparently from the policy advisory's vector with low impact on each of confidentiality, integrity and availability. The log specific advisory scores it 5.0 Moderate, with confidentiality low and no integrity or availability impact. The description in the record, though, mentions reading and updating logs, so it spans both.
The log advisory says a request naming different job IDs could let an authenticated user read all job logs stored in the Harbor database. The record's kev flag is false.
Weakness class per the record: CWE-285, CWE-863.
How to check if you're exposed
Find the Harbor version. The administration UI shows it, and the system information API reports it as harbor_version (it may need credentials depending on your setup):
curl -s https://harbor.example.com/api/v2.0/systeminfo
Replace the host name with your registry. Then compare the result with the patched versions above. If Harbor runs in Kubernetes, also check the image tags of the Harbor core component:
kubectl get pods -n harbor -o jsonpath='{.items[*].spec.containers[*].image}'
The free in-browser dependency scan at gold.safeguard.sh/scan can also help you see Harbor related components in a manifest you upload.
What to do now
- Identify Harbor installations and their versions.
- Upgrade to 2.5.2 or later, or 2.4.3 or later on the 2.4 line, and use 2.5.3 or later if you follow the preheat policy advisory's text.
- Review whether job logs could contain registry URLs, tokens or internal host names, and rotate anything sensitive.
- Restrict accounts on the registry to those who need them.
Why it matters
Harbor is a registry, and in many companies it sits between build systems and production. Policies on tags, retention and image distribution protect what ships.
The flaw class is broken object level authorization. The API accepts an identifier for a policy, checks that you are logged in, and acts, without checking that the object belongs to a project you may change. Any authenticated user, including one with a low privileged role in one project, can reach other projects. That is why the advisory scores the scope as changed.
Job logs often hold internal addresses and sometimes credentials for the distribution provider. A cross project read exposes them to anyone with any account.
Quick check
Why do two scores exist for this CVE?
NVD references two Harbor advisories. One is rated 7.4 High and the other 5.0 Moderate. Treat the highest as the planning figure and patch.
Sources
- Safeguard Gold entry for CVE-2022-31671
- Harbor advisory GHSA-q76q-q8hw-hmpw
- Harbor advisory GHSA-3wpx-625q-22j7
Last reviewed: 19 October 2026.