/

CVE-2026-25505

Severity:

CRITICAL RISK

(9.8)

Authentication and Cryptographic Key Management Weakness

CVE-2026-25505

Analyzed

Vulnerability type

Category:

Authentication and Cryptographic Key Management Weakness

CWE:

CWE-306, CWE-321

Impact:

Complete Compromise of Application Functions and Data over the Network

Severity:

CRITICAL RISK

(9.8)

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

Bambuddy, a self-hosted print archive and management system for Bambu Lab 3D printers, exposes critical API functionality without proper authentication while also using a hardcoded secret key for signing JWTs.

An attacker who can reach the Bambuddy service may be able to forge valid-looking tokens or bypass authentication checks entirely and directly invoke management APIs, potentially taking control of print jobs, accessing stored data, or altering system configuration.

Affected context

This weakness affects Bambuddy instances that:

  • Are deployed in environments where the HTTP API is reachable over a network (LAN, VPN, or internet), and
  • Rely on JWT-based authentication for protecting API endpoints, and/or
  • Expose "ManyAPI" routes that are assumed to be authenticated but do not actually enforce checks.

In such setups, the presence of a hardcoded JWT signing key in source code and missing authentication enforcement on selected routes combine to make management and archive functions broadly accessible to anyone who can send requests to the service.

Exploit preconditions

  • Attack surface: Network-accessible Bambuddy HTTP API (e.g., from local network or internet if port-forwarded or reverse-proxied).
  • Required access: Ability to send HTTP requests to the Bambuddy instance; no valid account or credentials are strictly required for the affected routes.
  • Trigger point: Direct calls to ManyAPI endpoints that do not validate authentication, or use of the published hardcoded JWT secret to forge tokens.
  • Why exploitation is possible:
  • CWE-306 (Missing Authentication for Critical Function): Critical API operations are exposed without any authentication checks.
  • CWE-321 (Use of Hard-coded Cryptographic Key): The JWT signing secret is embedded in the codebase, so anyone with access to the source can derive it and generate arbitrary tokens that the server will accept as valid.

Why this happens

At the design level, the application mixes security-critical functionality (printer management, archive access) into routes that either do not enforce authentication or assume a trusted caller.

This matches CWE-306, where authentication is missing for operations that should require identity verification.

In parallel, the JWT implementation relies on a hardcoded secret committed to the repository, a pattern described by CWE-321.

Instead of loading a per-deployment secret from secure configuration, the same static key is used across all installs, making it trivial for an attacker who knows or guesses the key to create valid JWTs and impersonate any user or role.

Potential impact

  • Remote takeover of Bambuddy management functions without valid credentials
  • Unauthorized access to archived print files and associated metadata
  • Creation, modification, or deletion of printer jobs and profiles
  • Tampering with configuration or stored content, potentially disrupting 3D printing workflows
  • Use of the Bambuddy instance as a pivot point for further attacks within the local network

General mitigation guidance

Effective mitigation focuses on enforcing strong authentication boundaries and eliminating static secrets:

  • Introduce mandatory authentication checks on all management and data-modifying API routes; default new endpoints to "authenticated required" and explicitly opt out only when strictly necessary.
  • Replace hardcoded JWT secrets with deployment-specific secrets loaded from environment variables, configuration files outside of version control, or dedicated secret management services.
  • Design the API with least-privilege roles so that tokens only grant the minimal permissions required for a given client.
  • Limit exposure of the Bambuddy service by restricting network access (e.g., bind to trusted interfaces, protect via reverse proxies and network ACLs).
  • Document secure deployment practices so operators understand that the API should not be exposed directly to untrusted networks.

How teams detect issues like this

Potential detection approaches include:

  • Static analysis and code review:
  • Flag presence of hardcoded secrets, keys, or tokens in source files and configuration.
  • Check all controller and route definitions to ensure that sensitive endpoints are wrapped in authentication/authorization middleware.
  • Configuration and policy checks:
  • Enforce policies that disallow committing secrets to version control.
  • Require that new routes declare their authentication requirements explicitly.
  • Runtime monitoring:
  • Log all access to management or configuration endpoints and alert on unusual or unauthenticated calls.
  • Automated security scanning tools can assist by scanning commit histories and repositories for secret patterns and checking framework routing configuration for missing auth decorators/middleware.

Sources

SourceLink
github.comgithub.com/maziggy/bambuddy/blob/a9bb8ed8239602bf08a9914f85a09eeb2bf13d15/backend/app/core/auth.py#L28
github.comgithub.com/maziggy/bambuddy/blob/main/CHANGELOG.md
github.comgithub.com/maziggy/bambuddy/commit/a82f9278d2d587b7042a0858aab79fd8b6e3add9
github.comgithub.com/maziggy/bambuddy/commit/c31f2968889c855f1ffacb700c2c9970deb2a6fb
github.comgithub.com/maziggy/bambuddy/pull/225
github.comgithub.com/maziggy/bambuddy/releases/tag/v0.1.7
github.comgithub.com/maziggy/bambuddy/security/advisories/GHSA-gc24-px2r-5qmf

Frequently asked

questions

Yes, if the Bambuddy API is reachable over a network from untrusted clients, an attacker can leverage the missing authentication on ManyAPI routes or the hardcoded JWT secret to interact with sensitive endpoints remotely.

In many cases, no. The lack of authentication checks on specific routes means some functionality can be accessed anonymously. Even where JWTs are expected, the hardcoded secret allows an attacker who knows the key to forge valid tokens without possessing legitimate credentials.

Require authentication and, where appropriate, authorization checks on all management and data-changing endpoints, and move all cryptographic secrets, including JWT signing keys, out of the codebase into secure configuration that is unique per deployment.

Adopt a security-by-default API design where routes are protected unless explicitly marked public, enforce secret management policies that forbid hardcoded keys, and integrate automated checks in CI to flag new unauthenticated critical routes and committed secrets before release.

Find out what's already
exploitable in your codebase.