You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(onboard): reject an unsafe custom endpoint URL before any mutation
Custom endpoint intake validated only userinfo, query, and fragment
components (#9106), so an endpoint URL containing shell metacharacters,
percent-encoded control characters, raw control characters, or a
non-HTTP(S) value passed intake and reached the SSRF preflight, the
endpoint probe, provider registration, session checkpoint writes, and
registry writes before any deep layer rejected it — and nothing
rejected percent-encoded control characters at all.
One composite classification, unsafeEndpointUrlViolation, now owns the
rejection rules, and every custom endpoint intake consumes it before
mutating state: onboarding intake (interactive and non-interactive),
inference set --endpoint-url before DNS resolution, and rebuild resume
preflight, which treats a violating recorded value as unknown metadata.
The character allowlist matches the container startup-command token set
plus "~", so an accepted URL stays inert across every downstream
consumer; the sets stay separate because command tokens and endpoint
URLs are distinct contracts. Rejection reasons are static and never
echo the input. The #9106 class keeps its established message and hint,
and the inference set shape check keeps its established message for the
classes it already owned.
The integration rows prove the QA contract directly: a subprocess
onboard with an unsafe URL exits 1 with no probe request and no
onboard-session.json or sandboxes.json write under the test HOME.
The url-utils fan-in budget moves 29 -> 30 for the one new
inference-set importer, the same adjustment #9119 made for this file.
Fixes#9301
Signed-off-by: Dongni Yang <dongniy@nvidia.com>
Copy file name to clipboardExpand all lines: docs/inference/custom-endpoint-security.mdx
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,12 @@ Custom endpoint onboarding rejects endpoint URLs that contain userinfo, query, o
36
36
NemoClaw does not forward those components to the endpoint.
37
37
Configure the provider credential separately instead of putting it in the endpoint URL.
38
38
39
+
Custom endpoint onboarding also rejects an endpoint URL that contains control characters, percent-encoded control characters, spaces, shell metacharacters, or other characters outside the URL-safe ASCII set.
40
+
It also rejects an input that is not an absolute HTTP or HTTPS URL.
41
+
This rejection happens before any network request, provider registration, registry write, or sandbox and image mutation, so a rejected input changes no NemoClaw state.
42
+
The `inference set` command applies the same rejection classes to `--endpoint-url` before DNS resolution.
43
+
Sandbox rebuild applies the same rejection classes to recorded custom endpoint metadata and treats a violating value as unknown.
44
+
39
45
Managed provider defaults that do not provide an explicit custom endpoint through these paths are unaffected.
40
46
41
47
Custom endpoint onboarding has one narrower operator-controlled exception for corporate inference gateways.
Copy file name to clipboardExpand all lines: docs/reference/commands.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4737,7 +4737,7 @@ Set them before running `$$nemoclaw onboard`.
4737
4737
|`NEMOCLAW_LLAMACPP_RECIPE`| repository-owned managed-inference recipe ID | Selects the exact managed llama.cpp recipe when `NEMOCLAW_PROVIDER=install-llama-cpp`, including a compatible lower-priority profile. When unset, NemoClaw selects the unique highest-priority compatible automatic profile. An unknown recipe, an ambiguous selection, or a stale or incompatible readiness report fails before image, model, or runtime effects. |
4738
4738
|`NEMOCLAW_MODEL`| model ID | Selects an explicit model for a non-interactive onboarding run. NemoClaw preserves it across a detected provider switch, even when it matches the recorded provider's default. When this variable is unset during such a switch, NemoClaw ignores the `NEMOCLAW_PROVIDER_MODEL` compatibility fallback and uses normal provider model selection. |
4739
4739
|`NEMOCLAW_TOOL_DISCLOSURE`|`progressive` or `direct`| Selects progressive tool discovery or the prior direct-exposure behavior. Defaults to `progressive`; `--tool-disclosure` takes precedence when both are set. |
4740
-
|`NEMOCLAW_ENDPOINT_URL`| URL | Custom endpoint URL. Used together with `NEMOCLAW_PROVIDER=custom` for OpenAI-compatible endpoints or `NEMOCLAW_PROVIDER=anthropicCompatible` for Anthropic-compatible endpoints. Onboarding rejects a URL that contains userinfo, query, or fragment components. |
4740
+
|`NEMOCLAW_ENDPOINT_URL`| URL | Custom endpoint URL. Used together with `NEMOCLAW_PROVIDER=custom` for OpenAI-compatible endpoints or `NEMOCLAW_PROVIDER=anthropicCompatible` for Anthropic-compatible endpoints. Onboarding rejects a URL that contains userinfo, query, or fragment components. It also rejects a URL that contains control characters, percent-encoded control characters, spaces, shell metacharacters, or other characters outside the URL-safe ASCII set, and a value that is not an absolute HTTP or HTTPS URL. |
4741
4741
|`NEMOCLAW_COMPATIBLE_AUTH_MODE`|`none` or unset | Explicitly selects no authentication for an HTTP OpenAI-compatible endpoint using `localhost`, `127.0.0.1`, or `[::1]` and port `8000`, `11434`, or `11435` during non-interactive onboarding. |
4742
4742
|`NEMOCLAW_TRUSTED_PRIVATE_HOSTS`| comma-separated exact hostnames or IP literals | Allows operator-owned RFC1918, CGNAT, or IPv6 unique local destinations through supported inference, managed MCP, and custom-policy registration paths. Link-local metadata and other reserved ranges remain blocked; DNS resolution and exact address pinning remain active; wildcards are not supported. |
4743
4743
|`NEMOCLAW_TRUSTED_PRIVATE_INFERENCE_HOSTS`| comma-separated exact hostnames or IP literals | Inference-only compatibility alias. Inference onboarding combines entries from this variable and `NEMOCLAW_TRUSTED_PRIVATE_HOSTS`. |
0 commit comments