Skip to content

Bug: Personal Vault stores plaintext passwords and allows unsafe note paths #15759

Open

Description

@mdyusuf98786-cloud

Repository commit

unknown

Python version (python --version)

Python 3.x

Dependencies version (pip freeze)

The app uses a local users.json file and standard library modules only. No dependency list was provided for the sample application.

Expected behavior

The Personal Vault application should not store passwords in plaintext, and note filenames should be validated before being used to construct filesystem paths. The login flow should verify credentials securely and user note operations should remain confined to the current vault directory.

Actual behavior

The sample application stores each password in users.json as plaintext and compares it directly during login. It accepts arbitrary note names and uses them to build paths under the user's vault without validating or normalizing them. This can allow credential disclosure and filesystem access outside the intended vault directory, and file operations can crash or behave unexpectedly when an invalid path is used.

Activity

  1. Pankajk001 commented on Nov 24, 2026

    @Pankajk001

    Hi @TheAlgorithms team,

    I would like to work on this issue!

    I looked into maths/number_of_digits.py and the root cause: num_digits_fast() relies on floating-point math.log10(), which suffers from precision loss on large integers near powers of 10 (such as 10**16 - 1).

    I can implement a solution that:

    1. Fixes the floating-point off-by-one boundary discrepancy.
    2. Keeps performance optimal without degrading speed for standard inputs.
    3. Adds doctests and regression test cases (e.g. testing 10**16 - 1 and boundary transitions).

    Could you please assign this issue to me? Thanks!

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions