Severity:

CRITICAL RISK

(9.4)

Hard-Coded Credentials in GoHarbor Harbor Web UI

CVE-2026-4404

Analyzed

Vulnerability type

Category:

Hard-Coded Credentials

CWE:

CWE-798, CWE-1393

Impact:

Authentication Bypass and Account Compromise

Severity:

CRITICAL RISK

(9.4)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

GoHarbor Harbor versions 2.15.0 and below ship with hard-coded default credentials that can be used to access the web UI.

If administrators do not change these default credentials, an attacker who can reach the Harbor interface may log in and gain high-privilege control over the registry.

Affected context

This vulnerability affects Harbor container registry deployments where default or hard-coded credentials remain active on the web UI.

It is most relevant in environments where Harbor is exposed over a network (internal or external) and initial setup procedures do not enforce changing the default password.

The risk increases significantly when Harbor is reachable from untrusted networks or the internet, or where web UI roles are highly privileged by default.

Exploit preconditions

  • Attack surface: Harbor web UI login endpoint over HTTP/HTTPS
  • Required access: Network access to the Harbor UI (no prior authentication needed)
  • Trigger point: Submitting the known default username/password combination at the login form
  • Why exploitation is possible: The product ships with a static, well-known default credential that remains valid unless explicitly changed, enabling attackers to authenticate as a legitimate user.

Why this happens

The core issue is the presence and continued validity of hard-coded default credentials mapped to CWE-798: Use of Hard-coded Credentials.

Harbor relies on a built-in password for initial access, and does not reliably enforce its rotation or removal during setup, leaving a shared secret that is predictable and widely known.

This pattern violates secure authentication principles by embedding fixed credentials and trusting them beyond initial provisioning.

CWE-1393 is also relevant in that design and configuration practices allow these default secrets to persist into production, rather than treating them as temporary bootstrap artifacts that must be replaced.

Potential impact

  • Attackers could log in to the Harbor UI with administrative or elevated privileges.
  • Attackers could push, pull, delete, or overwrite container images, leading to supply-chain compromise.
  • Attackers could create or manage user accounts, projects, and access tokens.
  • Attackers could exfiltrate sensitive configuration information, including repository metadata and integration settings.
  • Attackers could weaken or disable security controls within Harbor, such as scanning or access policies.

General mitigation guidance

Effective mitigation centers on eliminating persistent default credentials and enforcing strong, unique secrets from the start.

Recommended patterns include:

  • Requiring password change or admin account re-provisioning during first login, blocking normal use until this is complete.
  • Integrating Harbor authentication with external identity providers (e.g., SSO, LDAP, OIDC) so that hard-coded local credentials are unnecessary or heavily restricted.
  • Applying least-privilege by limiting what any bootstrap or local admin account can do until it has been reconfigured with unique credentials.
  • Treating configuration and bootstrap secrets as sensitive infrastructure parameters, managed via secret management systems rather than embedded defaults.
  • Enforcing configuration checks or policy-as-code that fail deployments where default credentials are detected.

How teams detect issues like this

Identifying this class of issue generally involves configuration review and policy enforcement rather than code-level analysis alone.

Potential strategies include:

  • Automated configuration audits that attempt login with known default credentials as part of security scanning or CI/CD checks.
  • Infrastructure-as-code or deployment policy rules that ensure admin passwords and secrets are provided explicitly and are not left at defaults.
  • Runtime compliance checks that flag Harbor instances with unchanged bootstrap accounts or weak credential patterns.
  • Manual or automated reviews of authentication flows in the codebase to ensure any hard-coded credentials are restricted to temporary bootstrap mechanisms with enforced rotation.

Sources

SourceLink
cwe.mitre.orgcwe.mitre.org/data/definitions/1393.html
github.comgithub.com/goharbor/harbor/issues/1937
github.comgithub.com/goharbor/harbor/pull/22751
goharbor.iogoharbor.io/docs/1.10/install-config/run-installer-script/#:~:text=If%20you%20did%20not%20change%20them%20in%20harbor.yml,%20the%20default%20administrator%20username%20and%20password%20are%20admin%20and%20Harbor12345
kb.cert.orgkb.cert.org/vuls/id/577436

Frequently asked

questions

Yes, if the Harbor web UI is accessible over the network and the default credentials have not been changed, an attacker can authenticate remotely using the known password.

Only network access to the Harbor web interface is required; no existing account or prior foothold is necessary if the default password is still valid.

Ensure that default credentials are eliminated or rotated during provisioning, enforce mandatory password changes on first use, and where possible rely on external identity providers instead of local hard-coded accounts.

Design systems so that no persistent hard-coded credentials exist, require unique secrets at deployment time, use secret management tooling, and enforce policies that block deployments where default accounts or passwords are still in use.

Find out what's already
exploitable in your codebase.