Skip to content

fix: validate sandbox names to prevent shell injection#45

Closed
areporeporepo wants to merge 1 commit intoNVIDIA:mainfrom
aircloudy-co:fix/validate-sandbox-names
Closed

fix: validate sandbox names to prevent shell injection#45
areporeporepo wants to merge 1 commit intoNVIDIA:mainfrom
aircloudy-co:fix/validate-sandbox-names

Conversation

@areporeporepo
Copy link
Copy Markdown
Contributor

@areporeporepo areporeporepo commented Mar 16, 2026

Summary

  • Sandbox and instance names from user input are interpolated directly into shell commands (openshell sandbox connect ${name}, docker run --name ${name}, etc.) without validation
  • A name containing shell metacharacters (;, $(), backticks, pipes) could execute arbitrary commands on the host
  • Add validateName() to runner.js enforcing ^[a-zA-Z0-9][a-zA-Z0-9._-]{0,62}$ and call it at the three entry points: CLI sandbox dispatch, deploy, and onboard

Test plan

  • nemoclaw my-assistant connect — valid name, works as before
  • nemoclaw "test; echo pwned" connect — rejected with clear error
  • nemoclaw onboard with empty name input → defaults to my-assistant (valid)
  • nemoclaw deploy good-name-123 — passes validation
  • nemoclaw deploy '$(whoami)' — rejected

Happy GTC!

🤖 Generated with Claude Code

Sandbox names from user input are interpolated into shell commands
without sanitization. A malicious name with shell metacharacters
could execute arbitrary commands.

Add validateName() in runner.js that enforces [a-zA-Z0-9._-]{1,63}
and call it at all entry points: CLI dispatch, deploy, and onboard.

Signed-off-by: Anh Nguyen <29374105+aprprprr@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: anh nguyen <29374105+aprprprr@users.noreply.github.com>
futhgar added a commit to futhgar/NemoClaw that referenced this pull request Mar 16, 2026
Sandbox and instance names from user input are interpolated directly
into shell commands (openshell sandbox connect, docker run --name, etc.)
without validation. A name containing shell metacharacters could execute
arbitrary commands on the host.

Add validateName() to runner.js enforcing ^[a-zA-Z0-9][a-zA-Z0-9._-]{0,62}$
and call it at the three user-input entry points:

- CLI sandbox dispatch (nemoclaw <name> <action>)
- deploy command (nemoclaw deploy <instance-name>)
- onboard wizard (sandbox name prompt)

Includes 7 unit tests covering valid names, length limits, empty input,
shell metacharacter rejection, and custom error labels.

Fixes NVIDIA#45

Signed-off-by: futhgar <jmaldonado.rosa@gmail.com>
@aircloudy-co aircloudy-co closed this by deleting the head repository Mar 17, 2026
mafueee pushed a commit to mafueee/NemoClaw that referenced this pull request Mar 28, 2026
Replace all GitLab-specific skill workflows with GitHub equivalents:
- create-gitlab-mr -> create-github-pr (gh pr create)
- review-gitlab-mr -> review-github-pr (gh pr diff/view)
- create-gitlab-issue -> create-github-issue (gh issue create)
- watch-gitlab-pipeline -> watch-github-actions (gh run)
- Update review-security-issue, fix-security-issue, build-from-issue
  to use gh CLI and GitHub API patterns
- Update CONTRIBUTING.md references
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants