Skip to content

[Housekeeping] Security hardening + repo hygiene cleanup #4

Description

@inii-sayaa

Labels: security, chore, documentation

Items

  1. qml_app/models.py (save/load, lines ~118, ~124): hyperparameters are stored
    with raw pickle.dumps/pickle.loads. If this .pkl file is ever shared or
    downloaded from an untrusted source, pickle.loads can execute arbitrary code.
    Suggest switching to json for this simple hyperparameter dict.

  2. qml_app/main.py (line 132): torch.load(...) doesn't pass weights_only=True
    explicitly. This is safe by default on torch>=2.6 (this repo pins torch==2.9.0),
    but being explicit protects against future default changes.

  3. README.md lists Qiskit as part of the tech stack (badge + description), but
    there is no import qiskit anywhere in the codebase, and qiskit is not in
    requirements.txt. Either add the dependency/usage or update the README.

  4. 5 .DS_Store files are committed to the repo (.DS_Store, artifacts/.DS_Store,
    artifacts/kernel/.DS_Store, artifacts/vqc/.DS_Store, qml_app/.DS_Store).
    Suggest git rm --cached them and add .DS_Store to .gitignore.

  5. .gitignore excludes artifacts/, but artifacts/convert.py, artifacts/script.py,
    artifacts/vqc/convert_pt_to_json.py, and the .DS_Store files under artifacts/
    are already tracked (added before the ignore rule existed). This is confusing
    for contributors — worth clarifying intent (untrack them, or move the helper
    scripts outside artifacts/).

  6. No automated tests exist in the repo. Even small unit tests around
    _align_with_qubits (data.py) and the kernel circuit output shape would have
    caught issue [Bug] Best-checkpoint saved during VQC training is not actually the best epoch's weights #2 above much earlier.

Severity

Low-to-medium - none of these block correctness, but #1 is worth prioritizing
if model files are ever distributed publicly.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions