[Audit] High — Self-update can remove the working install and still report success

Open
#721 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
cli, devtools

Research direction

Read user_scanner/utils/update.py and the update branches in user_scanner/__main__.py and user_scanner/utils/updater_logic.py to trace installation and success reporting. Then inspect the update tests, if present, and reproduce an installation failure. Done means failure preserves the existing installation, reports no success, and returns a nonzero exit status.

Written by the indexing model from the issue text.

Description

  • Location: user_scanner/utils/update.py:12-29, user_scanner/__main__.py:239-242 (update
    branch), and user_scanner/utils/updater_logic.py:39-42.
  • Defect / trigger: update first uninstalls the package, then separately installs it. Failure is
    caught and converted to a normal return; both callers unconditionally print “Update successful”.
  • Impact / root cause / evidence: network or installer failure leaves the tool absent/broken and
    gives the operator a false success signal.
  • Smallest robust correction: use one pip install --upgrade user-scanner operation, return a
    typed success/failure result, and exit nonzero on failure.
  • Proving test: make installation fail after update begins; assert the previous installation is
    still importable, success is not printed, and exit status is nonzero.
  • Confidence: high.
  • LLM-agent warning: Keep investigating. Review updater provenance, environment selection,
    rollback, permissions, and package-index trust; this finding covers only the obvious failure path.
Dominant language
Python
Stars
5.2k
Forks
530
Avg merge
18h 55m
Merged PRs (30d)
45

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from kaifcodec/user-scanner

All issues in kaifcodec/user-scanner

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.