Skip to content

feat(cli/init): validate instance name at CLI level #87

@coderabbitai

Description

@coderabbitai

Summary

When running the init command with --runtime podman, the instance name (e.g. passed as the workspace name) is later used to construct paths like <storageDir>/instances/<name> and Podman image/container identifiers. Values like ../foo or a/b could escape the instances directory or create invalid Podman names.

Validation should be added at the CLI level (in the init command) to reject names that:

  • Contain path separators (/ or \)
  • Contain traversal segments (..)
  • Are otherwise invalid as Podman/container identifiers

Only safe identifiers (e.g. alphanumerics, hyphens, underscores) should be accepted.

References

/cc @feloy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions