/

CVE-2026-136181

Severity:

HIGH RISK

(7.5)

Missing Authentication (CWE-306) in cnpmcore Registry API

CVE-2026-136181

Received

Vulnerability type

Category:

Missing Authentication

CWE:

CWE-306

Impact:

Upstream Registry Credential Disclosure and Unauthorized Package Access

Severity:

HIGH RISK

(7.5)

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

cnpmcore registry endpoints can disclose upstream registry authentication tokens because they lack AdminAccess middleware. An unauthenticated attacker who obtains a token may replay it as a Bearer credential to access or publish packages upstream, depending on the token's permissions.

Affected context

The issue affects cnpmcore versions 3.46.0 before 3.84.3 and 4.0.0 before 4.37.3. The GET /-/registry and GET /-/registry/:id endpoints can expose upstream registry authTokens when requests are not protected by AdminAccess middleware.

Exploit preconditions

  • Attack surface: The cnpmcore registry HTTP API, specifically the affected GET endpoints
  • Required access: No authentication is required to request these endpoints
  • Trigger point: A request to /-/registry or /-/registry/:id
  • Why exploitation is possible: The endpoints lack AdminAccess middleware and can return upstream authentication tokens that may be replayed as Bearer credentials

Why this happens

The underlying issue is a missing authorization check on endpoints that expose sensitive credentials. This maps to CWE-306: Missing Authentication for Critical Function: access to registry configuration and its authTokens is not restricted to authenticated, authorized callers.

Potential impact

  • An attacker may obtain upstream registry credentials
  • Leaked tokens could allow package enumeration or downloads, subject to token permissions
  • An attacker could publish or modify upstream packages if the token permits it
  • Downstream users may be exposed to malicious or tampered packages

General mitigation guidance

Defensive measures generally focus on protecting secret-bearing endpoints and limiting the authority of credentials.

  • Require authentication and appropriate authorization for registry configuration endpoints
  • Avoid returning raw upstream tokens in API responses; expose only the minimum necessary information
  • Apply least privilege and scope upstream credentials to required operations and packages
  • Store and handle tokens through secure secret-management mechanisms, with rotation and revocation procedures
  • Use secure-by-default access controls and treat registry configuration as sensitive data

How teams detect issues like this

Review route definitions and middleware chains for endpoints that return registry configuration or credentials. Static analysis and code review can flag sensitive response fields, routes without authentication or authorization checks, and inconsistent middleware coverage across related endpoints. Policy checks can require access controls on secret-bearing API routes, while monitoring can identify unexpected unauthenticated requests and upstream token use.

Sources

SourceLink
github.comgithub.com/cnpm/cnpmcore/blob/v3.84.2/app/port/controller/RegistryController.ts#L28-L46
github.comgithub.com/cnpm/cnpmcore/blob/v4.37.2/app/port/controller/RegistryController.ts#L34-L58
github.comgithub.com/cnpm/cnpmcore/commit/0bf0052597985100480522b1a59815b85c09b29e
github.comgithub.com/cnpm/cnpmcore/commit/1309cb2cd619de7351467e2b4ba2a02b5647930a
github.comgithub.com/cnpm/cnpmcore/releases/tag/v3.84.3
github.comgithub.com/cnpm/cnpmcore/releases/tag/v4.37.3
github.comgithub.com/cnpm/cnpmcore/security/advisories/GHSA-9rww-324g-xwph
vulncheck.comvulncheck.com/advisories/cnpmcore-3.46.0-before-3.84.3-and-4.0.0-before-4.37.3-registry-authtoken-disclosure

Frequently asked

questions

It may be reachable over the network wherever the affected cnpmcore endpoints are exposed; the described requests do not require authentication.

No authenticated account is required to request the affected endpoints. The impact of a disclosed token depends on its permissions.

Enforce authentication and authorization on sensitive registry endpoints, and avoid returning upstream credentials in responses.

Treat tokens and registry configuration as sensitive, apply least privilege, and include route-level authorization checks in code review and automated policy enforcement.

Find out what's already
exploitable in your codebase.