Bound FreeOTP backup PBKDF iteration count

Open Beginner friendly
#1,845 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
android, java
Domain
mobile, security

Research direction

Read FreeOtpImporter.EncryptedState and follow how mIterations reaches PBKDFTask.Params and PBKDFTask.deriveKey. Compare the validation in the andOTP importer and the bundled FreeOTP 2 fixtures, which use 100,000 iterations. Done when FreeOTP imports reject non-positive or excessive counts while valid fixtures still work.

Written by the indexing model from the issue text.

Description

Summary

The FreeOTP 2 importer reads the backup's mIterations value and passes it to PBKDF2 without an application-level upper bound. A sufficiently large positive value could cause unusually high CPU use or a long delay during import, depending on the device and crypto provider. I have not measured this behavior or established a practical threshold, so impact and severity remain unconfirmed.

Scope / trigger

This requires the user to select and import a crafted FreeOTP backup. I have not created or tested such a backup. This report is limited to a potential import-time availability impact; it does not claim vault confidentiality loss or code execution.

Source evidence
  • FreeOtpImporter.EncryptedState reads mIterations from the backup and supplies it to PBKDFTask.Params.
  • PBKDFTask.deriveKey passes the count to the PBKDF2 implementation.
  • The andOTP importer separately validates its imported PBKDF count and rejects counts above 10,000,000.
  • The bundled FreeOTP 2 test fixtures use 100,000 iterations.
Suggested consideration

Consider validating FreeOTP's iteration count against a format-compatible upper bound before starting key derivation, and handling invalid counts as an import error. This report is based on source inspection; runtime impact is unverified.

Dominant language
Java
Stars
13.7k
Forks
626
Avg merge
10d 12m
Merged PRs (30d)
2

Getting set up

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 beemdevelopment/Aegis

All issues in beemdevelopment/Aegis

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.