Hi Mridul,

Thanks for re-testing — good to hear the earlier fixes held up. Addressed
everything below on both PRs.

*Blocking*

- Timed lockouts now clear correctly with MFA enabled: the
login.disable.minutes re-enable was gated behind !deferSuccessCommit, so it
never ran on an MFA-pending login. Restored unconditionally, with a narrow
doStore path so the rest of the commit still stays deferred until MFA
completes.

- HttpBasicAuthFilter now sends plain username/password to
userLoginMfaPending instead of login.username/login.password —those keys
were triggering ServiceDispatcher.checkAuth()'s own pre-auth, committing
successiveFailedLogins/UserLoginHistory on every REST token call regardless
of MFA state.

- A wrong code on the REST verify endpoint now returns the intended error
instead of a 400 — verifyRestMfaChallenge() was passing a null Locale into
UtilProperties.getMessage(), which throws instead of localizing.

- Forced enrollment no longer replays its confirming code against the login
challenge it already satisfies — confirmForcedTotpEnrollment marks that
challenge VERIFIED directly and completes the login via a shared
completeVerifiedMfaLogin().

- reverifyAuthFactor now counts a wrong code toward the account-wide
lockout (it had no challenge of its own to rate-limit on before), and
generateBackupCodes always requires the current password, matching
createUserLoginTotpFactor/revokeUserLoginAuthFactor.

- An enrolled user is now challenged consistently regardless of the global
switch — form login, the header/cert/remote-user/Tomcat-SSO path, and JWT
all fall back to hasActiveFactor() like REST already did. The preprocessor
path also stopped setting PRIMARY_VERIFIED on its own, since that could
finish a login without a verified challenge now that it can require MFA for
real.

- Added reverifyAuthFactor to the storefront (request-map, screen/template,
and the authFactorRequired response on revokeMfaFactor/generateBackupCodes).

- APIAuthFilter and checkJWTLogin now check ServiceUtil.isError() on the
isUserLoginMfaRequired result, not just a thrown exception; added
APIAuthFilterMfaFailClosedTests alongside the existing
AuthenticationResourceMfaFailClosedTests.

*Should fix*

- testMfaBackupRecoveryCodes compiles and passes again (missing
HashCrypt/LoginServices imports).

- Restored the title separator and   in HtmlFormMacroLibrary.ftl,
emptied by the base commit unrelated to MFA.

- Corrected the guide's password-change-gating claim — that integration was
already reverted; reworded to describe what the gate actually covers
(backup-code generation and factor revocation).

- Also corrected the entity count (three new entities plus one field on
SecurityGroup, not four), challengeStatus's listed values
(PENDING/VERIFIED/CONSUMED/LOCKED, not EXPIRED), and the eventType list
(was missing several real values and listed one, MFA_ADMIN_PASSWORD_RESET,
that nothing records); replaced a stale admin-recovery reference and added
the missing totpWindowSteps config line.

- Test-suite counts fixed too — and added the two REST MFA fail-closed test
suites that weren't listed at all.

*Housekeeping*

- Updated the PR title and descriptions in both ofbiz-framework and plugins
(PNG, not SVG; covers backup codes and the re-verify flow).

- beginForcedTotpEnrollment is POST-only on both the framework and
storefront controllers; the purge job is now scheduled daily off the shared
MIDNIGHT_DAILY expression.

- Externalized one remaining hardcoded "MFA Setup" link label
(flatgrey/helveticus/rainbowstone) the earlier UI-text pass had missed.


*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

On Mon, Nov 23, 2026 at 1:05 PM Mridul Pathak via dev <[email protected]>
wrote:

> Hi Krishna,
>
> Thanks for the update and for working through everything so thoroughly. I
> applied both PRs on current trunk again and re-tested with MFA enabled,
> disabled, and enabled together with header login.
>
> What I can confirm from testing:
>
> * Wrong codes now count towards the account lockout on the web login.
> * An account disabled while it waits at the challenge page stays disabled
> and is not logged in.
> * The REST verify step is tied to the API group of the challenge, and the
> login history is written only after the second factor.
> * Backup codes, replay rejection and the new re-verify step all work.
> * With MFA disabled, the REST token endpoint and the normal lockout
> recovery behave as before.
>
> A few things still need work before it can be merged. I have put the
> details in a comment on the framework PR (
> https://github.com/apache/ofbiz-framework/pull/2620#issuecomment-7094327612
> ),
> the main ones being:
>
> * With MFA enabled, a timed lockout is never lifted, also for users who
> have no factor.
> * On REST, each token request resets the failed-login counter, so the
> lockout is not reached there.
> * One of the new integration tests fails, and the form macro change in the
> common theme is still in.
>
> On the SSO limitation you describe (header, JWT, remote user and
> certificate logins cannot show the challenge), I confirmed that these
> logins fail closed: a user who needs a second factor is simply not logged
> in, so there is no way around the factor. I am fine with documenting it for
> a first version, since the feature is off by default and a trusted proxy
> can be configured. If anyone on the list sees a problem with shipping it
> that way, it would be good to hear it now.
>
> Happy to test again once the remaining points are addressed.
>
> Regards,
> Mridul Pathak
>
> On Sat, Nov 21, 2026 at 4:39 PM Krishna Uprit <
> [email protected]> wrote:
>
> > 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> <+91%2079993%2004341>
> <+91%2079993%2004341>
> > http://www.hotwaxsystems.com
> >
>

Reply via email to