Skip to content

Negative Tests for TOTP and Backup Codes #1240

Closed

Description

@fejilaup-cloud

Labels: testing, security, api-server
Priority: High
Estimated Time: 2 hours

Description:
The 2FA tests check only success paths. No test rejects a wrong TOTP code, a reused code, or a used backup code, which is why item 40 went unnoticed.

Tasks:

  • Add tests for wrong, reused, and out-of-window TOTP codes
  • Add tests for reused backup codes and codes from another user
  • Add a test that enrollment without a current factor fails

Related existing issues: #984

Imported from the AtomicIp_130.md backlog (item 102).

Activity

  1. 244345 commented on Oct 20, 2026

    @244345

    @244345 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Hi maintainer, I'd very much appreciate the opportunity to work on this issue.
    Having reviewed the acceptance criteria, I'm confident that I'd be able to have a PR up shortly after being assigned.
    Kindly assign this issue to me.
    Thank you!

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @244345 to this issue.

  2. Divine639700 commented on Oct 20, 2026

    @Divine639700

    @Divine639700 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Hi maintainer, I’d like to add negative tests for TOTP and backup code verification, covering invalid, reused, and expired codes. I’ll also test cross-user backup code rejection and ensure 2FA enrollment fails when no current factor exists.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Divine639700 to this issue.

  3. Wiseman52 commented on Oct 20, 2026

    @Wiseman52

    @Wiseman52 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Hi, kindly assign task. I’m confident I can take ownership of this task and deliver a well-tested solution that meets your expectations.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Wiseman52 to this issue.

  4. Rayyanah0 commented on Oct 20, 2026

    @Rayyanah0

    @Rayyanah0 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Hi, i can work on this issue please assign me

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Rayyanah0 to this issue.

  5. OmniZlatoon commented on Oct 20, 2026

    @OmniZlatoon

    @OmniZlatoon has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Can I be your contributor for this issue sir

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @OmniZlatoon to this issue.

  6. cythecode commented on Oct 20, 2026

    @cythecode

    @cythecode has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Hi maintainer, I’d love to work on this issue! I've reviewed the requirements and can submit a PR shortly. Could you please assign it to me?

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @cythecode to this issue.

  7. drips-wave commented on Oct 20, 2026

    @drips-wave

    Congratulations, @Rayyanah0! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.

    🧑‍💻 @Rayyanah0: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  8. grantfox-oss commented on Oct 21, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox!

    @Rayyanah0's PR #1301 was approved and merged by @fejilaup-cloud.

    🏆 @Rayyanah0: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (411 total points). Track your full progress on GrantFox.

    👏 Great work, @Rayyanah0! Keep contributing to AtomicIP.

  9. drips-wave commented on Oct 21, 2026

    @drips-wave

    This issue has been completed by @Rayyanah0 as part of the Stellar Wave Program's 10th Wave 🥳

    😎 @Rayyanah0: You earned 150 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions