Invitations: an existing account gets a registration link, and unchecked input creates broken invitees
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 70/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- php
- Domain
- authentication
Research direction
Start with settingspage::invite() in system/datatypes/settings.php around line 112, then read the member list logic around line 676 and the related user and mail functions. Trace the supplied reproduction cases for existing accounts, comma-separated addresses, and empty input. Done means invalid or existing-account addresses are handled safely, users are added once, and pending invitees display correctly.
Written by the indexing model from the issue text.
Description
settingspage::invite() (system/datatypes/settings.php:112) does not check what it gets:
- Address of an existing account.
hypha_addUser()refuses the address (user exists), but the result is ignored;hypha_getUserByEmail()then returns the existing account andhypha_addUserRegistrationKey()gives that account a registration key. The invitation mail goes to the owner of the account with asettings/register/<key>link, through which the user name, password, e-mail and language of that account can be set. Any member can do this for any account, including an administrator's. Together with #425 (invitation keys fromuniqid(), never expiring) this leaves a standing password-reset link on accounts that did not ask for one. - No validation of the input. The field is split on
,withouttrim()orfilter_var().[email protected], [email protected]stores the second address with a leading space;sendMail()then refuses it, but the invitee is kept. An empty field creates an invitee without an address. hypha_addUser()is called twice per address (lines 119 and 123); for an empty address the second call creates a second, empty user without key.- The member list shows invitation pending only for
rights == 'invite'(line 676), but invitees haverights="invitee", so an open invitation shows as a row with empty name columns.
Steps to reproduce. Log in as a member, settings → invite: (1) the administrator's address: the administrator account gets a key attribute and an invitation mail; (2) [email protected], [email protected]: the second invitee has email=" [email protected]"; (3) an empty field: two users without address are added.
Tested on PHP 8.2, 8.4 and 8.5 with a fictional test site (main, d97ab7b). Suggested direction: trim and validate each address, refuse addresses that already belong to an account (or only re-send for invitees), call hypha_addUser() once and compare with 'invitee' in the member list.
- Dominant language
- JavaScript
- Stars
- 5
- Forks
- 9
- Avg merge
- 18h 49m
- Merged PRs (30d)
- 13
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PlanBCode/hypha
-
Component: User interface Impact: Low Level: Easy Pagetype: Peer reviewed article Type: Bug Value: Visitors
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Impact: Medium Level: Easy Type: Bug Value: Users
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Impact: Low Level: Easy Pagetype: Festival Type: Bug Value: Coders
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Impact: Medium Level: Easy Pagetype: Mailinglist Type: Bug Value: Users
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
Impact: Low Level: Easy Type: Bug Value: Coders
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
PlanBCode/hypha#586 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
riverqueue/river#1576 ·
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
good first issue help wanted
Difficulty 1/5 Under an hour Newbie friendliness 88/100
modrollstudio/Modroll-Studio-Website#80 · 1 comment ·
Maintainers usually reply within 1 day
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
mafzalkalwardev/mailforge#21 ·
-
good first issue help wanted
Difficulty 1/5 Under an hour Newbie friendliness 82/100