/

CVE-2023-27573

Severity:

CRITICAL RISK

(9.0)

Use of Hard-coded Credentials in netbox-docker

CVE-2023-27573

Analyzed

Vulnerability type

Category:

Use of Hard-coded Credentials

CWE:

CWE-1392, CWE-798

Impact:

Authentication Bypass and Full Administrative Compromise

Severity:

CRITICAL RISK

(9.0)

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

netbox-docker prior to version 2.5.0 ships with a superuser account that uses a known default password and a predictable SUPERUSER_API_TOKEN value.

If these defaults are not changed, an attacker who can reach the deployment can authenticate as an administrator or use the API token to fully control the NetBox instance.

Affected context

This vulnerability affects netbox-docker deployments created from versions prior to 2.5.0 where:

  • The default admin user password has not been changed, and/or
  • The SUPERUSER_API_TOKEN remains set to the documented default value.

It is especially risky when netbox-docker is exposed beyond an isolated development or lab network, such as in production or Internet-accessible environments. The issue arises because installation and startup flows did not enforce overriding these defaults, relying instead on documentation to warn about their unsafe use in production.

Exploit preconditions

  • Attack surface: HTTP(S) web interface and REST API of a netbox-docker instance.
  • Required access: Network-level access to the NetBox service (e.g., from the local network, VPN, or the public Internet).
  • Trigger point:
  • Web login using the default admin credentials, and/or
  • API requests authenticated with the default SUPERUSER_API_TOKEN.
  • Why exploitation is possible: The system ships with a known, static password and API token for the superuser account. No installation-time checks or enforcement mechanisms require the operator to change these values before the service becomes reachable, allowing attackers to successfully authenticate with publicly known secrets.

Why this happens

The underlying issue is the use of hard-coded and documented default credentials for a highly privileged account, without enforcement that these credentials must be changed before production use.

This aligns with CWE-798: Use of Hard-coded Credentials and CWE-1392: Use of Default Cryptographic Keys, IVs, or Secrets, where secrets are embedded or fixed as part of a product's defaults rather than being generated uniquely per deployment.

In netbox-docker, both the superuser password and SUPERUSER_API_TOKEN are initialized with known values to simplify development setups, but the product's behavior did not distinguish clearly between development and production contexts or technically require operators to configure unique credentials.

Potential impact

  • An attacker can log in as the admin superuser via the web UI and gain full administrative access.
  • An attacker can use the default SUPERUSER_API_TOKEN to issue privileged API requests without needing interactive login.
  • Complete read and modification access to all stored network inventory and configuration data.
  • Ability to create, modify, or delete user accounts, tokens, and permissions.
  • Potential pivot into broader infrastructure if NetBox data or integrations are used to automate or orchestrate network or system changes.
  • Loss of data integrity and confidentiality, including exposure of sensitive topology, IP addressing, and device information.

General mitigation guidance

Effective mitigation focuses on eliminating reliance on shared defaults and enforcing unique, high-entropy secrets per deployment:

  • Ensure the superuser password is set to a strong, unique value during bootstrap and never left at any documented default.
  • Regenerate the SUPERUSER_API_TOKEN with a randomly generated, high-entropy value and rotate it periodically.
  • Adopt deployment patterns that distinguish clearly between development and production, with production configurations requiring explicit secret provisioning (e.g., via environment variables, secret managers, or CI/CD pipelines).
  • Apply least-privilege principles by limiting the number and scope of superuser tokens; prefer scoped, role-based tokens where possible.
  • Restrict network exposure of netbox-docker to only trusted networks, fronting it with authentication proxies, VPNs, or access controls.
  • Incorporate secret generation and rotation into infrastructure-as-code and deployment automation so that defaults are never used in persistent environments.

How teams detect issues like this

Detecting and preventing this class of issue involves combining configuration checks, code review, and operational controls:

  • Implement configuration audits or startup checks that fail fast if default credentials or tokens are detected in environment variables or configuration files.
  • Use infrastructure-as-code scanning to flag hard-coded or known-default secrets in manifests, compose files, and Helm charts.
  • During code and configuration review, treat any embedded credentials, default tokens, or example secrets as security findings that require explicit override mechanisms.
  • Apply policy-as-code tools (e.g., Open Policy Agent, specialized IaC linters) to enforce rules such as "no default admin passwords" or "no known token values."
  • Monitor authentication logs and API usage for patterns consistent with default credential use (e.g., successful admin logins from unexpected sources immediately post-deployment).
  • Periodically run internal security tests or automated checks that attempt to authenticate with known defaults, ensuring that production systems reject them.

Sources

SourceLink
github.comgithub.com/netbox-community/netbox-docker/issues/953
github.comgithub.com/netbox-community/netbox-docker/pull/959
github.comgithub.com/netbox-community/netbox-docker/releases/tag/2.5.0

Frequently asked

questions

Yes. If a vulnerable netbox-docker instance is reachable over the network and still uses the default admin password or SUPERUSER_API_TOKEN, an attacker can authenticate remotely using the known values.

The attacker only needs network access to the NetBox service endpoint (web UI or API). No prior authentication, user account, or local system access is required if the defaults remain in place.

Replace all default credentials and tokens with strong, unique, randomly generated values as part of deployment, and enforce this in automation. Implement mechanisms that prevent the application from starting or becoming externally reachable if defaults are still configured.

Avoid shipping production-capable configurations with usable default admin accounts or tokens. Require secrets to be provided externally (e.g., via secret managers), enforce unique secret generation in deployment tooling, and embed automated checks in CI/CD and runtime that reject known or hard-coded default credentials.

Find out what's already
exploitable in your codebase.