Skip to content

[Bug]: update --timeout accepts partially numeric strings despite positive-integer contract #83281

@giodl73-repo

Description

@giodl73-repo

Summary

A local code audit found that update CLI timeout parsing accepts partially numeric strings even though the option contract is a positive integer in seconds.

Affected area

  • src/cli/update-cli/shared.ts
  • parseTimeoutMsOrExit

Repro

Pass values such as --timeout 1.5 or --timeout 10abc to an update subcommand. The parser accepts the numeric prefix instead of rejecting the full value.

Expected

The parser should reject any value that is not entirely a positive integer string.

Suggested fix

Trim the input and require a full-string decimal integer match, then verify the parsed number is a safe positive integer before converting seconds to milliseconds.

Suggested regression test

Add update CLI timeout validation cases for 1.5 and 10abc that expect the existing positive-integer error and exit path.

Source: local code audit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.maintainerMaintainer-authored PR

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions