Skip to content

devbox run -lq … panics in ShorthandLookup (multi-char shorthand) #3113

Open

Description

@mikeland73

Severity (from the audit): High

  • Where: internal/boxcli/run.go:301.
  • Cause: wrapArgsForRun calls runFlags.ShorthandLookup(strings.TrimLeft(arg, "-")). pflag panics when the name is longer than one character.
  • Impact:
  • Confirmed: Running devbox run -lq foo bar printed can not look up shorthand which is more than one ASCII character and exited with status 0.
  • Fix: Look up only arg[1:2] for single-dash arguments, or return args unchanged when the name is longer than one character.

Found by an automated code audit, listed as finding #25 in specs/bug-checks.md (#3061). Line numbers refer to commit f7d01a7.

Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions