Hi Mridul,
Thanks for the detailed review and for testing this locally — really
helpful. I've addressed everything below on both PRs; commit-level detail
and the full channel-by-channel behavior matrix are in the linked document.
* Testing findings:* - Failed second-factor attempts now increment
successiveFailedLogins too (not just the per-challenge counter), on both
the web and REST paths, disabling the
account at the same threshold a wrong password would.
- An account disabled while the user is waiting at the challenge screen
now fails at completion instead of being logged in and silently re-enabled
— both
the challenge-verification step and markSuccessfulLogin itself re-check
the enabled flag before finishing the login.
- The REST challenge's own sessionBindingHash now decides which API group
a token is minted for; a mismatched group path is rejected, and the group's
configured base permission is checked before issuing it.
- Basic Auth no longer runs the committing userLogin service up front —
it defers to the non-committing userLoginMfaPending, and only commits
(UserLoginHistory, lockout reset) once the second factor is actually
satisfied.
- Added a reverifyAuthFactor endpoint: a gated action whose proof has
gone stale now stashes what the user submitted and replays it automatically
once they
re-verify, instead of just failing.
- Header/JWT/remote-user/certificate logins: It's a RequestHandler
preprocessor-chain constraint— these paths can't
currently surface a challenge view even when the primary auth succeeds
— and fixing it properly looked like it needed a core framework change, not
an
MFA-scoped one. I've documented it as a known limitation for now rather
than ship a partial workaround.
* Design points:* - Added single-use backup recovery codes (ULAF_BACKUP)
on both the web and storefront, and stopped blocking forgot-password email
recovery for MFA accounts
— it never bypassed the second factor to begin with.
- Added the channel-by-channel doc as being asked for (sy-MFA.adoc),
covering every entry point and how each behaves under MFA, including the
limitation above.
- Replaced dev.samstevens.totp with a small, self-contained TOTP/HOTP
implementation on javax.crypto, verified against all 6 RFC 6238 Appendix B
test
vectors.
- Switched the REST token's amr claim from "totp" to the RFC
8176-registered "otp"/"fido", and added WebAuthn/passkey slots to the
factor-type enumeration
so neither needs a schema change later.
* Smaller things:* - Corrected the doc/code mismatches listed: QR code is
a PNG data URI (not SVG), there's no acr claim or totp.window property
(it's totpWindowSteps, a
clock-drift setting, not a re-auth window), and the re-auth window is
300 seconds.
- Reverted updatePassword routing, the common-theme password macro, and
the external login key lifetime back to their pre-MFA state on the
framework side,
and mirrored the updatePassword revert on the storefront, so nothing
changes for non-MFA deployments.
- Externalized the hardcoded UI text on both the framework and
storefront, and removed Working.md from the repo root — its content is
already covered more
accurately by sy-MFA.adoc.
*Updated Proposal Doc:*
https://docs.google.com/document/d/1v-ckX-nNaUrkK4dbs37LuTDN572hLdmc3wQKeilB7nY/edit?usp=sharing
*PRs:* #2620 (framework)
<https://github.com/apache/ofbiz-framework/pull/2620>, #523 (plugins)
<https://github.com/apache/ofbiz-plugins/pull/523>
Please let me know if anything requires further clarification.
Kind Regards,
Krishna Uprit
Application Security Engineer
*HotWax Systems*
*Enterprise open source experts*
cell: +91-7999304341 <+91%2079993%2004341>
http://www.hotwaxsystems.com