You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Personal Vault stores plaintext passwords and allows unsafe note paths #15759
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.
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:
Fixes the floating-point off-by-one boundary discrepancy.
Keeps performance optimal without degrading speed for standard inputs.
Adds doctests and regression test cases (e.g. testing 10**16 - 1 and boundary transitions).
Activity
Pankajk001 commentedon Nov 24, 2026
Hi @TheAlgorithms team,
I would like to work on this issue!
I looked into
maths/number_of_digits.pyand the root cause:num_digits_fast()relies on floating-pointmath.log10(), which suffers from precision loss on large integers near powers of 10 (such as10**16 - 1).I can implement a solution that:
10**16 - 1and boundary transitions).Could you please assign this issue to me? Thanks!