Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

identities leak #6125

Closed
driici opened this issue Jan 8, 2018 · 3 comments
Closed

identities leak #6125

driici opened this issue Jan 8, 2018 · 3 comments

Comments

@driici
Copy link

driici commented Jan 8, 2018

Today I came accross issue, when there were problem in postgres database:

Newly created user on roundcube should have same ID as allready created one (my own problem with wrongly configured sequence). Since no new user record can be created, error was logged, but I was unable to send email (failed authentication agains mail server). So far so good. But in Settings->Profiles (/?_task=settings&_action=identities) they`re were visible identities of other users, not only mine created.

DETAIL: Key (user_id)=(1476) already exists. (SQL Query: INSERT INTO "users" (" created", "last_login", "username", "mail_host", "language") VALUES (now(), now( ), '[email protected]', 'mailboy.xxx.cz', 'cs_CZ')) in /opt/roundcube /program/lib/Roundcube/rcube_db.php on line 543 (POST /?_task=login&_action=logi n)

Issue was resolved by manually altering sequence number. But Roundcube should not allow user to log-in if no user data can be correctly inserted into database.

@alecpl
Copy link
Member

alecpl commented Jan 8, 2018

Looks like checking insert ID might not be enough here https://github.com/roundcube/roundcubemail/blob/master/program/lib/Roundcube/rcube_user.php#L634. We have to use affected_rows() or is_error().

@alecpl alecpl added this to the 1.4-beta milestone Jan 8, 2018
@alecpl alecpl modified the milestones: 1.4-beta, 1.3.5 Jan 8, 2018
@hebbet
Copy link
Contributor

hebbet commented Jan 9, 2018

looks like there is a = missing in that line, too.

@alecpl
Copy link
Member

alecpl commented Jan 12, 2018

Fixed.

@alecpl alecpl closed this as completed Jan 12, 2018
@thomascube thomascube modified the milestones: 1.3.5, 1.3.4 Jan 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants