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.

