2-Factor Authentication spec#610
Conversation
|
|
||
| This specification adds the `draft/account-2fa` capability. | ||
|
|
||
| Servers advertising this capability accept the `2FA` command described |
There was a problem hiding this comment.
IRC grammar does not allow numbers inside of command names (with exception of numerics, which must be exactly 3 numbers). You need to pick a different command name. I suggest MFA since this could in theory be used for more than 2 factors as well with the introduction of biometric authentication types (e.g. passkeys).
Other aspects of this spec should be similarly edited to update "2fa" with the other chosen string for consistency.
|
|
||
| `<id>` values returned by `2FA LIST` and consumed by `2FA REMOVE` are | ||
| opaque ASCII strings, MUST contain only `A-Z a-z 0-9 - _`, MUST be at | ||
| most 32 characters, MUST NOT contain whitespace, and MUST be unique per |
There was a problem hiding this comment.
"MUST NOT contain whitespace" is superfluous as that is already forbidden by the specified set of allowed characters.
| account. | ||
|
|
||
| `<name>` values supplied by clients to `2FA ADD` are user-chosen labels. | ||
| They MUST contain only printable non-whitespace characters and MUST be at |
There was a problem hiding this comment.
"printable" is vague and there is no solid definition of that outside of the ASCII space. Specify precisely which characters are allowed here (or, more easily, which characters are forbidden and allow everything else)
| format as the corresponding step-up SASL mechanism (see [Two-Factor SASL | ||
| Flow](#two-factor-sasl-flow)). In particular: | ||
|
|
||
| * For `totp`, `<data>` is the 6-digit one-time password (no Base64). |
There was a problem hiding this comment.
"No base 64" is superfluous and should be removed.
|
|
||
| The server MUST reject the request with | ||
| `FAIL 2FA INVALID_CHALLENGE_RESPONSE` if the proof does not verify. This | ||
| prevents disabling 2FA with only the password. |
There was a problem hiding this comment.
This is already prevented because if 2-factor auth is enabled, they won't be able to fully authenticate without passing it. This entire section should be reworked tbh as it seems more like a footgun than anything else. A server may choose to not allow a user to remove their final second authentication factor (that is, require 2FA in some fashion). But if a server doesn't choose to allow that, we shouldn't be requiring the user to validate that they have precisely the thing they want to remove.
If you want to have an extra challenge on removal for additional assurance, allow them to authenticate using any of their registered secondary factors in order to remove them from the list.
| single-factor login in this state, as that would defeat the purpose of | ||
| 2FA when the credential store has been tampered with. | ||
|
|
||
| ### Step-up SASL Mechanisms |
There was a problem hiding this comment.
This entire section should be removed, since we shouldn't be using SASL for this. The previous registry can be used for both enrollment and authentication.
| replies with `NOTE 2FA REGISTRATION_CHALLENGE` (see | ||
| [Responses](#responses)). The challenge SHOULD be valid for at most 120 | ||
| seconds and SHOULD be invalidated after a successful `2FA ADD` of the | ||
| same type. |
There was a problem hiding this comment.
I touch more on this below, but this command should be used for actual authentication. For enrollment, just use ADD for the entire process (even if it requires multiple back and forth messages).
| No Registered Credentials](#account-with-no-registered-credentials)) | ||
| rather than degrading to single-factor. Treating credential loss as | ||
| "2FA effectively off" would let an attacker who can write to the | ||
| credential store bypass 2FA. |
There was a problem hiding this comment.
If an attacker can write to the credential store, they can either disable the 2FA flag entirely or inject their own credentials that they are in possession of, so this isn't a particularly compelling reason. Come up with something better or omit the explanation.
| ``` | ||
|
|
||
| ## Security Considerations | ||
|
|
There was a problem hiding this comment.
This section appears to be normative given the proliferation of MUST. I recommend that all of these notes be rolled into the actual specification text instead of living at the bottom of the document. This section should instead be moved into non-normative prose explaining security considerations in a human-understandable manner.
| * `external` - a TLS client-certificate fingerprint, used as the | ||
| second factor via the standard | ||
| [`EXTERNAL`](https://datatracker.ietf.org/doc/html/rfc4422#appendix-A) | ||
| SASL mechanism. |
There was a problem hiding this comment.
I would remove this listing from this section as it's just an additional place to (forget to) update as other mechs are added. The introduction section is more for human-readable prose to let people understand why the spec exists and what problems it solves. Diving into implementation details this early mostly serves to raise more questions than it answers.
Implemented and in use by ObsidianIRC and ObbyIRCd
vidya-2026-05-04_05.30.58.webm