/

CVE-2026-59158

Severity:

HIGH RISK

(7.5)

Exposed API Key (CWE-522) in Nuxt Ollama Integration

CVE-2026-59158

Deferred

Vulnerability type

Category:

Exposure of Sensitive Information

CWE:

CWE-522

Impact:

Unauthorized API Access and Credential Exposure

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

Nuxt Ollama exposes a configured Ollama Cloud API key by placing it in Nuxt's public runtime configuration, which is serialized into server-rendered HTML. Any unauthenticated client that retrieves an affected page may obtain the key and use it for unauthorized cloud requests, potentially consuming operator resources or accessing permitted data.

Nuxt Ollama exposes a configured Ollama Cloud API key by placing it in Nuxt's public runtime configuration, which is serialized into server-rendered HTML. Any unauthenticated client that retrieves an affected page may obtain the key and use it for unauthorized cloud requests, potentially consuming operator resources or accessing permitted data.

Affected context

The issue occurs in Nuxt Ollama deployments that configure a cloud API key through the module options. The module unconditionally merges that option into runtimeConfig.public.ollama, and Nuxt may include the resulting value in the window.__NUXT__ payload delivered to browsers. The application does not need to visibly invoke an Ollama request for the credential to be exposed.

The issue occurs in Nuxt Ollama deployments that configure a cloud API key through the module options. The module unconditionally merges that option into runtimeConfig.public.ollama, and Nuxt may include the resulting value in the window.__NUXT__ payload delivered to browsers. The application does not need to visibly invoke an Ollama request for the credential to be exposed.

Exploit preconditions

  • Attack surface: Server-rendered Nuxt pages and their serialized runtime configuration
  • Required access: Ability to request an affected public page; authentication is generally not required
  • Trigger point: Rendering or fetching a page whose payload contains the public Ollama configuration
  • Why exploitation is possible: A secret API key is placed in a client-visible configuration namespace and may also be used by browser-side code as a bearer credential
  • Attack surface: Server-rendered Nuxt pages and their serialized runtime configuration
  • Required access: Ability to request an affected public page; authentication is generally not required
  • Trigger point: Rendering or fetching a page whose payload contains the public Ollama configuration
  • Why exploitation is possible: A secret API key is placed in a client-visible configuration namespace and may also be used by browser-side code as a bearer credential

Why this happens

The vulnerability results from treating a secret cloud API key as public runtime configuration. Values stored in runtimeConfig.public are intended for browser exposure, and Nuxt serializes them into the server-rendered payload. The runtime composable then reads the exposed value for client-side authorization, creating an insecure credential-handling pattern that maps to CWE-522, where authentication information is insufficiently protected from disclosure.

The vulnerability results from treating a secret cloud API key as public runtime configuration. Values stored in runtimeConfig.public are intended for browser exposure, and Nuxt serializes them into the server-rendered payload. The runtime composable then reads the exposed value for client-side authorization, creating an insecure credential-handling pattern that maps to CWE-522, where authentication information is insufficiently protected from disclosure.

Potential impact

  • An attacker may make unauthorized Ollama Cloud API requests using the exposed key
  • The operator may incur unexpected usage charges or consume service quotas
  • Attackers could exhaust rate limits and disrupt legitimate application activity
  • An exposed key may permit access to stored models or conversations within its granted scope
  • The credential could be reused in other workflows until revoked or rotated
  • An attacker may make unauthorized Ollama Cloud API requests using the exposed key
  • The operator may incur unexpected usage charges or consume service quotas
  • Attackers could exhaust rate limits and disrupt legitimate application activity
  • An exposed key may permit access to stored models or conversations within its granted scope
  • The credential could be reused in other workflows until revoked or rotated

General mitigation guidance

Mitigation focuses on keeping cloud credentials exclusively on trusted server-side boundaries.

Common defensive patterns include:

  • Store API keys in private server runtime configuration rather than public configuration
  • Proxy Ollama Cloud requests through server-side handlers that enforce authorization
  • Ensure browser bundles, rendered HTML, and serialized state never contain bearer credentials
  • Use narrowly scoped credentials with the minimum required permissions
  • Apply secret rotation, revocation, and usage monitoring procedures
  • Treat any previously exposed key as compromised and replace it through established credential-management processes

Mitigation focuses on keeping cloud credentials exclusively on trusted server-side boundaries.

Common defensive patterns include:

  • Store API keys in private server runtime configuration rather than public configuration
  • Proxy Ollama Cloud requests through server-side handlers that enforce authorization
  • Ensure browser bundles, rendered HTML, and serialized state never contain bearer credentials
  • Use narrowly scoped credentials with the minimum required permissions
  • Apply secret rotation, revocation, and usage monitoring procedures
  • Treat any previously exposed key as compromised and replace it through established credential-management processes

How teams detect issues like this

Organizations can detect this class of issue through:

  • Static analysis rules that flag secrets assigned to public runtime configuration
  • Code review checks for API keys passed into browser-side composables or bundles
  • Rendered-page inspections for credential-like values in window.__NUXT__ and related payloads
  • CI policies that scan generated HTML, client assets, and configuration output for secrets
  • Runtime monitoring for unexpected API usage, quota consumption, or access from unusual locations

Automated secret-scanning and dependency-review tools may help identify accidental exposure during development and release workflows.

Organizations can detect this class of issue through:

  • Static analysis rules that flag secrets assigned to public runtime configuration
  • Code review checks for API keys passed into browser-side composables or bundles
  • Rendered-page inspections for credential-like values in window.__NUXT__ and related payloads
  • CI policies that scan generated HTML, client assets, and configuration output for secrets
  • Runtime monitoring for unexpected API usage, quota consumption, or access from unusual locations

Automated secret-scanning and dependency-review tools may help identify accidental exposure during development and release workflows.

Sources

SourceLink
github.comgithub.com/thoda-dev/nuxt-ollama/commit/156e813783ef322ee10dbbdd6bf446a449e1a04f
github.comgithub.com/thoda-dev/nuxt-ollama/releases/tag/v1.3.1
github.comgithub.com/thoda-dev/nuxt-ollama/security/advisories/GHSA-fxg7-897c-57mp

Frequently asked

questions

Yes. An unauthenticated user who can fetch an affected server-rendered page may be able to read the API key from the serialized Nuxt payload.

No. Following the cloud configuration path can place the key in the public payload even if the visible application template does not invoke an Ollama operation.

Keep the API key in private server-side configuration and route cloud requests through a trusted server boundary. Do not place bearer credentials in public runtime configuration or browser-delivered state.

Classify configuration values by trust boundary, enforce secret-scanning and rendered-output checks in CI, use least-privilege credentials, and monitor cloud API usage for signs of misuse.

Yes. An unauthenticated user who can fetch an affected server-rendered page may be able to read the API key from the serialized Nuxt payload.

No. Following the cloud configuration path can place the key in the public payload even if the visible application template does not invoke an Ollama operation.

Keep the API key in private server-side configuration and route cloud requests through a trusted server boundary. Do not place bearer credentials in public runtime configuration or browser-delivered state.

Classify configuration values by trust boundary, enforce secret-scanning and rendered-output checks in CI, use least-privilege credentials, and monitor cloud API usage for signs of misuse.

Find out what's already
exploitable in your codebase.