CVE-2026-59158
JavaScript vulnerability analysis and mitigation

Overview

CVE-2026-59158 is a credentials exposure vulnerability in the nuxt-ollama npm package that causes Ollama cloud API keys to be leaked in plaintext to any unauthenticated browser client. The flaw affects nuxt-ollama versions >= 1.2.26 and < 1.3.1, and was first published by the maintainer on June 20, 2026, with the advisory added to the GitHub Advisory Database on September 9, 2026. It carries a CVSS v3.1 base score of 7.5 (High) (GitHub Advisory).

Technical details

The root cause is a design flaw in src/module.ts (CWE-522: Insufficiently Protected Credentials). During Nuxt module setup, the entire _options object — including the api_key field — is unconditionally merged into Nuxt's public runtime config namespace (runtimeConfig.public.ollama) via runtimeConfig.public.ollama = defu(currentConfig, _options). Nuxt's SSR pipeline then serializes runtimeConfig.public and embeds it verbatim in every server-rendered HTML page inside a <script> block (window.__NUXT__), making the API key readable by any HTTP client. The browser-side composable (src/runtime/composables/useOllama.ts) subsequently reads this value and forwards it as an Authorization: Bearer header in client-side API calls, completing the exposure chain (GitHub Advisory, Security Advisory).

Impact

Any unauthenticated party — including passive network observers, web crawlers, or anonymous visitors — who performs a single HTTP GET request to an affected application can extract the Ollama cloud API key from the window.__NUXT__ payload in the HTML response. Consequences of key theft include unauthorized use of the Ollama cloud API at the operator's expense, rate-limit exhaustion or billing quota abuse, potential data exfiltration if the key grants read access to stored models or conversations, and reputational damage or service disruption. End-users of the affected application are not directly at risk, but operators who follow the official documentation to configure ollama.api_key are fully exposed without any awareness (GitHub Advisory).

Exploitability

A public proof-of-concept (PoC) is included in the GitHub Security Advisory, consisting of a Dockerfile and Python script that reproduce the leak against a containerized vulnerable application with a single unauthenticated HTTP GET request. No special tools, credentials, or user interaction are required. There is no evidence of in-the-wild exploitation or threat actor attribution at this time, and the CVE is not listed in the CISA KEV catalog. EPSS score data is not yet available for this CVE (GitHub Advisory).

Exploitation steps

  1. Reconnaissance: Identify internet-facing Nuxt applications using nuxt-ollama versions >= 1.2.26 and < 1.3.1 configured with a cloud api_key. This can be done via web search, Shodan, or by inspecting npm dependency manifests in public repositories.
  2. Send unauthenticated HTTP GET request: Issue a simple HTTP GET to the root (or any SSR-rendered page) of the target application:
    curl -s https://target-app.example.com/
  3. Extract the API key from the HTML response: Parse the window.__NUXT__ script block in the returned HTML to locate the api_key field:
    curl -s https://target-app.example.com/ | grep -o 'api_key":"[^"]*"'
  4. Use the stolen API key: Authenticate to the Ollama cloud API using the extracted key as a Bearer token to make arbitrary API requests at the operator's expense:
    curl -H 'Authorization: Bearer <STOLEN_KEY>' https://api.ollama.com/api/...
    (GitHub Advisory, Security Advisory)

Indicators of compromise

  • Network: Unexpected or anomalous HTTP GET requests to the application root or SSR-rendered pages from unfamiliar IPs, particularly automated/scripted user agents; outbound API calls to api.ollama.com from IP addresses not associated with legitimate users.
  • Logs: Web server access logs showing high-frequency or scripted GET requests to the application homepage; Ollama cloud API usage logs reflecting requests from unexpected IP addresses or at unusual times/volumes.
  • File System: Presence of window.__NUXT__ payloads containing api_key in plaintext within cached or logged HTTP responses.
  • Billing/API Usage: Unexpected spikes in Ollama cloud API usage, billing charges, or quota exhaustion not attributable to normal application traffic (GitHub Advisory).

Mitigation and workarounds

Upgrade nuxt-ollama to version 1.3.1 or later, which moves api_key to the private runtime config (runtimeConfig.ollama) and removes it from the public namespace. As an interim workaround, operators should avoid setting ollama.api_key in the module options and instead proxy Ollama API calls through a server-side route that injects the key server-side only. Immediately rotate any Ollama cloud API keys that may have been exposed on affected deployments (GitHub Advisory, Security Advisory).

Community reactions

The vulnerability was reported by EQSTLab and published by the maintainer (thoda-dev) on June 20, 2026, with the advisory formally added to the GitHub Advisory Database on September 9, 2026. No significant broader media coverage or notable public researcher commentary beyond the advisory itself has been identified at this time (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-59160HIGH8.8
  • JavaScript logoJavaScript
  • @yeger/turbo-graph
NoYesSep 09, 2026
CVE-2026-59179HIGH8.3
  • JavaScript logoJavaScript
  • @openhop/server
NoYesSep 09, 2026
GHSA-x7m8-jrm8-hpvxHIGH8.1
  • JavaScript logoJavaScript
  • @eigenpal/docx-editor-core
NoYesSep 10, 2026
CVE-2026-59176HIGH7.8
  • JavaScript logoJavaScript
  • functype-mcp-server
NoYesSep 09, 2026
CVE-2026-59158HIGH7.5
  • JavaScript logoJavaScript
  • nuxt-ollama
NoYesSep 09, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management