Commit Graph
2 Commits
Author SHA1 Message Date
Lauri Ojansivu 433ff5506c SignupBleed: guard the sign-up form's own method, and keep ordinary sign-up working.
The browser test found two faults in dd36db3641. The real door is
useraccounts' ATCreateUserServer - the method the sign-up form calls, which
picks the profile fields and passes the rest of the client's options to
Accounts.createUser - not Meteor's createUser, which useraccounts already
refuses to clients. Verified against the code before this change: with
registration disabled, ATCreateUserServer with from: 'admin' created the
account. Both methods are wrapped now. And the wrapper handed the original
method a copy, so audit-argument-checks refused every ordinary sign-up ("Did
not check() all arguments"); the client's own arguments are check()ed first.

The browser test now signs up ordinarily first, then makes both attempts the
way the form does (hashed password) on fresh connections, and resets the
shared unknown-user lockout of 127.0.0.1 before and after. The LinkedWriteBleed,
RepointBleed and BackgroundBleed browser tests use a fresh account per refused
attempt and check it is disabled - a refused attempt costs the account.

Thanks to xet7 !
2026-10-02 11:02:21 +03:00
Lauri Ojansivu dd36db3641 Close the SignupBleed DDP sibling: a client sign-up cannot claim admin or LDAP creation.
Accounts.onCreateUser trusts from: 'admin' (admin or REST creation, which
skips the registration checks) and ldap: true (directory account, allowed while
registration is disabled) as server-only signals, and Meteor's createUser DDP
method passes the client's options through unchanged. With "Disable
registration" on, anyone could still create an account by adding either.

The createUser method is wrapped so a client's options lose the server-only
keys; the server's own callers - the admin method, POST /api/users, the LDAP
package - call Accounts.createUserAsync directly and keep them. An attempt is
recorded as SignupBleed. The negative test fails if onCreateUser trusts another
option as an early-return signal without it being stripped from clients; a
browser test signs up both ways with registration disabled.

Thanks to xet7 !
2026-10-02 10:39:40 +03:00