[Audit] Medium — Configuration is stored inside the installed package and rewritten non-atomically

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Start with user_scanner/core/helpers.py at lines 444 and 723–764, then read user_scanner/core/hudson.py lines 15–20 to trace configuration loading and writes. The issue calls for investigating all mutable state under package and repository paths and defining ownership, permissions, migration, corruption, and concurrency behavior. Done means configuration uses a platform user-config directory, has a defined schema, writes atomically with explicit errors, and the listed failure scenarios are covered.

Written by the indexing model from the issue text.

Description

  • Location: user_scanner/core/helpers.py:444,723-764 and
    user_scanner/core/hudson.py:15-20.
  • Defect / trigger: default config.json lives under site-packages/user_scanner; normal runs
    create/overwrite it directly. Read-only/system installs fail, upgrades may erase preferences,
    concurrent writers can truncate or lose updates, and malformed JSON is silently replaced.
  • Impact / root cause / evidence: startup/update prompts become unreliable and configuration
    loss is concealed.
  • Smallest robust correction: use the platform user-config directory, validate a defined schema,
    and write atomically with explicit error reporting and appropriate permissions.
  • Proving test: read-only package directory, concurrent writers, interrupted write, malformed
    JSON, and package upgrade preserve or clearly report configuration state.
  • Confidence: high.
  • LLM-agent warning: Keep investigating. Find all mutable state under package/repository paths
    and define ownership, permissions, migration, corruption, and concurrency behavior.
Dominant language
Python
Stars
5.2k
Forks
530
Avg merge
1d 2h
Merged PRs (30d)
50

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.