---
id: "CVE-2026-59158"
kind: "vulnerability"
aliases: ["CVE-2026-59158"]
title: "Nuxt Ollama module leaks cloud API key into public page payload"
severity: "high"
cvss: 7.5
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["javascript", "nuxt", "nuxt-ollama", "ollama", "package", "self-hosted"]
not_affected_if: ["local-ollama-no-cloud-key", "version-1.3.1-or-later"]
published_at: "2026-10-27T23:17:06+00:00"
first_seen_at: "2026-10-27T23:29:44+00:00"
updated_at: "2026-10-27T23:31:19+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-59158", "first_seen_at": "2026-10-27T23:29:44+00:00"}]
---

# Nuxt Ollama module leaks cloud API key into public page payload

The nuxt-ollama module copies its configured cloud api_key into the public runtime config, which Nuxt serializes into the server-rendered HTML window.__NUXT__ payload. Any visitor who loads a page can read the key in plaintext and use it for unauthorized Ollama cloud requests, spending quota or reading stored models and conversations the key can access.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed version: `npm ls nuxt-ollama` (or the matching lockfile entry).
- Search the project config for a cloud key: `grep -rn "api_key" nuxt.config.*`.
- Load a page and search the HTML source for the key or `window.__NUXT__` containing an `ollama` block with `api_key`.

## Fix

- Upgrade the nuxt-ollama package to `1.3.1` or later.
- Rotate the Ollama cloud API key after upgrading, since it may already have been exposed in served pages.
- Move the key to a server-only runtime config value so it is never placed in the public config.

## Timeline

- 2026-10-27T23:29:44+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-59158

## From the sources

Nuxt Ollama integrates the official Ollama JavaScript library into Nuxt applications. Prior to 1.3.1, `src/module.ts` unconditionally merges all module options, including a configured cloud `api_key`, into `runtimeConfig.public.ollama`. Nuxt serializes this public configuration into the server-rendered HTML `window.__NUXT__` payload, exposing the API key in plaintext to any unauthenticated client that fetches a page. `src/runtime/composables/useOllama.ts` also reads the public key and sends it as an `Authorization` `Bearer` credential in browser-side Ollama requests. Following the documented cloud configuration is sufficient; the visible application template need not make an Ollama request for the secret to leak. A stolen key permits unauthorized cloud API requests at the operator's expense, quota or rate-limit exhaustion, and access to stored models or conversations if the key grants those permissions. This issue is fixed in version 1.3.1.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
