Skip to content

Fail closed on unparseable semver during self-update - #543

Merged
anirudhwarrier merged 1 commit into
mainfrom
DEVSVCS-5289/update-fail-close
Jul 23, 2026
Merged

Fail closed on unparseable semver during self-update#543
anirudhwarrier merged 1 commit into
mainfrom
DEVSVCS-5289/update-fail-close

Conversation

@anirudhwarrier

@anirudhwarrier anirudhwarrier commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

DEVSVCS-5289

Fail closed on unparseable semver during self-update

Problem:
cre update previously proceeded with the update whenever it couldn't parse the current or latest version as semver (fail-open), allowing unintended downgrades or version jumps. Flagged by security review.

Fix:

  • Run now fails closed when either version is unparseable, returning an error and suggesting --force.
  • Added a --force/-f flag to restore the warn-and-proceed behavior when explicitly requested.
  • Normal downgrade/already-latest short-circuit is unchanged when both versions parse.
  • Tests: added coverage for fail-closed on unparseable latest (asserting no download attempted), unparseable current, and --force bypass.

If either the current or latest version cannot be parsed as semver, the
update now aborts instead of proceeding, preventing unintended downgrades
or version jumps. Add a --force/-f flag to override and update tests.
@anirudhwarrier
anirudhwarrier marked this pull request as ready for review July 23, 2026 09:36
@anirudhwarrier
anirudhwarrier requested a review from a team as a code owner July 23, 2026 09:36
@anirudhwarrier
anirudhwarrier enabled auto-merge July 23, 2026 11:36

@timothyF95 timothyF95 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@anirudhwarrier
anirudhwarrier added this pull request to the merge queue Jul 23, 2026
Merged via the queue into main with commit 7853c3b Jul 23, 2026
22 checks passed
@anirudhwarrier
anirudhwarrier deleted the DEVSVCS-5289/update-fail-close branch July 23, 2026 13:55
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