Skip to content

fix(security): warn when Ollama binds to 0.0.0.0 during onboard - #1877

Merged
ericksoa merged 3 commits into
NVIDIA:mainfrom
ColinM-sys:fix/ollama-0000-network-warning
Apr 16, 2026
Merged

fix(security): warn when Ollama binds to 0.0.0.0 during onboard#1877
ericksoa merged 3 commits into
NVIDIA:mainfrom
ColinM-sys:fix/ollama-0000-network-warning

Conversation

@ColinM-sys

@ColinM-sys ColinM-sys commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a user-visible warning during nemoclaw onboard when Ollama is started with OLLAMA_HOST=0.0.0.0, informing the user that their inference API is exposed to the local network without authentication.
  • Warning appears at both Ollama startup sites (existing install + brew install paths). Suppressed on WSL where Ollama binds to 127.0.0.1.

Why

NemoClaw's onboard flow forces OLLAMA_HOST=0.0.0.0:11434 so the Docker sandbox can reach the host. This silently exposes the unauthenticated Ollama API to the entire local network. On public WiFi (airports, coffee shops, hackathons), any adjacent device can:

  • Enumerate installed models (GET /api/tags)
  • Send arbitrary prompts and receive responses (POST /api/generate)
  • Consume GPU resources (denial of service)
  • Extract model metadata (POST /api/show)

Ollama's lack of authentication is well-documented:

  • CNVD-2025-04094 — Ollama unauthorized access due to misconfiguration
  • CVE-2024-37032 ("Probllama") — Ollama remote code execution
  • CVE-2024-39720 through CVE-2024-39722 — additional Ollama CVEs
  • 175,000+ exposed Ollama servers found in internet-wide scans (source)

NemoClaw is actively creating this exposure by overriding OLLAMA_HOST during automated onboard. The user is never warned.

What changed

  • src/lib/onboard.ts — added a warning block after each OLLAMA_HOST=0.0.0.0 startup call, referencing the known CVEs and explaining the risk.

What this does NOT change

  • The binding behavior itself is unchanged. Docker requires 0.0.0.0 to reach the host from inside the container.
  • A future PR should add a firewall rule or Docker network bridge to restrict access to localhost + the container bridge IP.

Test plan

  • npm run build:cli — compiles cleanly.
  • Manual: nemoclaw onboard with Ollama selected shows the warning on non-WSL systems.
  • Manual: WSL onboard does not show the warning (Ollama binds to 127.0.0.1 there).

Discovery

Identified during a code audit on 2026-04-07 (finding N-3 in my audit notes). The Ollama 0.0.0.0 exposure class has known CVEs but NemoClaw's role in forcing the insecure configuration has not been previously reported.

Summary by CodeRabbit

  • Bug Fixes
    • Show a console security warning when the local Ollama service is started and is reachable from the local network (bound to 0.0.0.0).
    • Suppress the warning when running under WSL.
    • On macOS, display the warning unconditionally after the service starts.

Signed-off-by: ColinM-sys cmcdonough@50words.com

NemoClaw's onboard flow starts Ollama with OLLAMA_HOST=0.0.0.0 so
the Docker-based sandbox can reach the host via host.docker.internal.
This silently exposes the unauthenticated Ollama API (port 11434)
to the entire local network. On public WiFi, any adjacent device
can enumerate models, send prompts, and consume GPU resources
without authentication.

The 0.0.0.0 binding is intentional (Docker requires it), but the
user is never informed of the exposure. Ollama's lack of
authentication is a known issue with multiple CVEs
(CNVD-2025-04094, CVE-2024-37032, CVE-2024-39720 through
CVE-2024-39722) and 175,000+ exposed servers found in internet-wide
scans.

Add a visible warning during onboard at both Ollama startup sites
(existing install and brew install paths) so the user knows their
inference API is network-accessible. The warning is suppressed on
WSL where Ollama binds to 127.0.0.1 by default.

This does not change the binding behavior — only informs the user.
A future fix should add a firewall rule or Docker network bridge
to restrict access to localhost + the container bridge.

Signed-off-by: ColinM-sys <cmcdonough@50words.com>
@coderabbitai

coderabbitai Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

Pull request was closed or merged during review

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 07a2632f-f804-4798-be55-5ff1bbb3ab4a

📥 Commits

Reviewing files that changed from the base of the PR and between 949fed1 and f1587af.

📒 Files selected for processing (1)
  • src/lib/onboard.ts

📝 Walkthrough

Walkthrough

Adds a console warning helper and prints a multi-line warning when Ollama is started bound to 0.0.0.0; the warning is suppressed under WSL in the "not running yet" startup path and always printed after starting Ollama in the macOS install/start path.

Changes

Cohort / File(s) Summary
Security Warning Messages
src/lib/onboard.ts
Added printOllamaExposureWarning() and inserted conditional console output when Ollama is started bound to 0.0.0.0. The warning is shown only if !isWsl() in the "not running yet" path and unconditionally after starting Ollama in the macOS install path.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 I sniffed the ports and tapped a key,
"0.0.0.0" — I whispered, "mind the sea!"
A little warning, bold and clear,
So nearby hosts won't wander near,
Hop safe, hop snug — that's my cheer.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a security warning when Ollama binds to 0.0.0.0 during the onboard process, which is the core objective of the PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/lib/onboard.ts (1)

3412-3417: Deduplicate the Ollama exposure warning text.

The same warning appears here and at Line 3348-Line 3352. Please extract it into a small helper to avoid message drift and keep setupNim from growing further.

♻️ Proposed refactor
+function printOllamaExposureWarning() {
+  console.log("");
+  console.log("  ⚠ Ollama is binding to 0.0.0.0 so the sandbox can reach it via Docker.");
+  console.log("    This exposes the Ollama API to your local network (no auth required).");
+  console.log("    On public WiFi, any device on the same network can send prompts to your GPU.");
+  console.log("    See: CNVD-2025-04094, CVE-2024-37032");
+  console.log("");
+}
...
-          if (!isWsl()) {
-            console.log("");
-            console.log("  ⚠ Ollama is binding to 0.0.0.0 so the sandbox can reach it via Docker.");
-            console.log("    This exposes the Ollama API to your local network (no auth required).");
-            console.log("    On public WiFi, any device on the same network can send prompts to your GPU.");
-            console.log("    See: CNVD-2025-04094, CVE-2024-37032");
-            console.log("");
-          }
+          if (!isWsl()) printOllamaExposureWarning();
...
-        console.log("");
-        console.log("  ⚠ Ollama is binding to 0.0.0.0 so the sandbox can reach it via Docker.");
-        console.log("    This exposes the Ollama API to your local network (no auth required).");
-        console.log("    On public WiFi, any device on the same network can send prompts to your GPU.");
-        console.log("    See: CNVD-2025-04094, CVE-2024-37032");
-        console.log("");
+        printOllamaExposureWarning();
As per coding guidelines, "Limit cyclomatic complexity to 20 in JavaScript/TypeScript files, with target of 15".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/lib/onboard.ts` around lines 3412 - 3417, Extract the repeated Ollama
exposure console.log block into a small helper (e.g., showOllamaExposureWarning
or logOllamaExposureWarning) and replace both duplicated blocks inside setupNim
with a call to that helper; ensure the helper reproduces the exact multi-line
message (including blank lines) and is declared near other logging utilities in
the file so setupNim shrinks and cyclomatic complexity is reduced.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/lib/onboard.ts`:
- Around line 3412-3417: Extract the repeated Ollama exposure console.log block
into a small helper (e.g., showOllamaExposureWarning or
logOllamaExposureWarning) and replace both duplicated blocks inside setupNim
with a call to that helper; ensure the helper reproduces the exact multi-line
message (including blank lines) and is declared near other logging utilities in
the file so setupNim shrinks and cyclomatic complexity is reduced.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9bbfd09e-a4a7-4bd7-a673-0bd5299e56c9

📥 Commits

Reviewing files that changed from the base of the PR and between 576fc9f and 1bbf2bd.

📒 Files selected for processing (1)
  • src/lib/onboard.ts

@cjagwani cjagwani self-assigned this Apr 14, 2026
@cjagwani
cjagwani requested a review from cv April 14, 2026 23:03
@cjagwani

Copy link
Copy Markdown
Collaborator

@ColinM-sys Great security contribution — the Ollama exposure warning is well-documented with CVE references. Code looks good.

DCO check is failing — commits need a Signed-off-by line:

git rebase HEAD~1 --signoff
git push --force-with-lease

Ready to merge once DCO passes.

@cjagwani
cjagwani requested a review from brandonpelfrey April 14, 2026 23:12
Signed-off-by: ColinM-sys <cmcdonough@50words.com>
@ColinM-sys
ColinM-sys force-pushed the fix/ollama-0000-network-warning branch from 5dc7690 to 949fed1 Compare April 14, 2026 23:19
@ColinM-sys

Copy link
Copy Markdown
Contributor Author

DCO sign-off added to both commits. Thanks for the review!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/lib/onboard.ts (1)

3355-3355: Make WSL suppression explicit at both warning call sites.

Line 3414 is currently safe because that branch is macOS-only, but matching the explicit !isWsl() guard used at Line 3355 would make the intent resilient to future flow changes.

♻️ Proposed small consistency patch
-        printOllamaExposureWarning();
+        if (!isWsl()) printOllamaExposureWarning();

Also applies to: 3414-3414

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/lib/onboard.ts` at line 3355, The warning call to
printOllamaExposureWarning() should be explicitly guarded by !isWsl() at both
call sites: keep the existing check at the location that already has if
(!isWsl()) printOllamaExposureWarning(); and add the same explicit if (!isWsl())
guard around the other invocation (the one referenced at the second call site)
so both places use isWsl() before calling printOllamaExposureWarning(), ensuring
intent is clear and resilient to future flow changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/lib/onboard.ts`:
- Line 3355: The warning call to printOllamaExposureWarning() should be
explicitly guarded by !isWsl() at both call sites: keep the existing check at
the location that already has if (!isWsl()) printOllamaExposureWarning(); and
add the same explicit if (!isWsl()) guard around the other invocation (the one
referenced at the second call site) so both places use isWsl() before calling
printOllamaExposureWarning(), ensuring intent is clear and resilient to future
flow changes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f6fc0b36-2b85-473a-9073-66a0d852c8c8

📥 Commits

Reviewing files that changed from the base of the PR and between 5dc7690 and 949fed1.

📒 Files selected for processing (1)
  • src/lib/onboard.ts

@cjagwani

Copy link
Copy Markdown
Collaborator

@ColinM-sys Correction on my earlier comment — DCO check on this repo looks at the PR body, not the commits. Just add this line anywhere in your PR description:

Signed-off-by: Your Name <your@email.com>

Edit the PR body, add the line, and DCO should pass. Same for #1878 if it hasn't been added there.

@ColinM-sys

Copy link
Copy Markdown
Contributor Author

Thank you so much for the guidance — added the sign-off to the PR description. Should be good now!

@ericksoa ericksoa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good — minimal, focused, correctly scoped to both Ollama startup paths with WSL suppression. CVE references are a nice touch.

@ericksoa
ericksoa merged commit b37e851 into NVIDIA:main Apr 16, 2026
7 of 8 checks passed
miyoungc added a commit that referenced this pull request Apr 16, 2026
## Summary
- Add "Ollama network exposure warning during onboard" troubleshooting
entry (from #1877)
- Document snapshot restore liveness preflight and clean restore
behavior (from #1901)
- Update Jetson troubleshooting for BSP R39+ support (from #1910)
- Document `--from` Dockerfile permission error handling (from #1931)
- Bump doc version switcher through 0.0.17
- Regenerate agent skills from updated docs

## Test plan
- [x] `make docs` builds without warnings
- [x] All pre-commit hooks pass
- [ ] Verify rendered pages in docs build output

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Documentation**
* Clarified onboarding error when build context contains unreadable
files.
* Updated snapshot restore: sandbox must be running; restore cleanly
replaces state directories and removes files added after the snapshot.
  * Added Jetson BSP R39 automatic configuration guidance.
* Added Ollama network-exposure security guidance for local provider
selection during onboarding.
* **Documentation (versions)**
* Added docs entry for version 0.0.17 and updated project docs version.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@wscurran wscurran added area: cli Command line interface, flags, terminal UX, or output area: local-models Local model providers, downloads, launch, or connectivity area: providers Inference provider integrations and provider behavior and removed priority: high labels Jun 3, 2026
@wscurran wscurran added bug-fix PR fixes a bug or regression and removed NemoClaw CLI labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli Command line interface, flags, terminal UX, or output area: local-models Local model providers, downloads, launch, or connectivity area: providers Inference provider integrations and provider behavior bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants