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

Impersonated guest user cannot logout #64

Closed
SergioBertolinSG opened this issue Oct 9, 2017 · 17 comments
Closed

Impersonated guest user cannot logout #64

SergioBertolinSG opened this issue Oct 9, 2017 · 17 comments
Assignees
Milestone

Comments

@SergioBertolinSG
Copy link

SergioBertolinSG commented Oct 9, 2017

Steps to reproduce

  1. Having impersonate and guest apps enabled.
  2. Create a group 'group1' and add some users, including one called 'group_admin', which is the group admin.
  3. Make 'group1' able for impersonation.
  4. Create a guest user by sharing a folder with an email. Using the guest user set a password to the account.
  5. Login with guest user. Check you can see the shared folder content.
  6. Add the guest user to the group 'group1'.
  7. As 'group_admin' impersonate guest user.
  8. Try to logout.

Expected behaviour

Impersonating user can logout. Or maybe simply the user should not be able to impersonate a guest user.

Actual behaviour

Logout fails and the account keeps snipping not being able to log out.

Server configuration

Operating system:
Ubuntu 16.04

Web server:
Apache

Database:
MySQL

PHP version:
7.0

ownCloud version: (see ownCloud admin page)
current Master
{"installed":"true","maintenance":"false","needsDbUpgrade":"false","version":"10.0.3.0","versionstring":"10.0.3 beta","edition":"Community","productname":"ownCloud"}

Updated from an older ownCloud or fresh install:
Fresh

The content of config/config.php:


Are you using external storage, if yes which one: local/smb/sftp/...
No.

Are you using encryption:
No.

Logs

Client configuration

Browser
Firefox

** browser logs **

Failed to load resource: the server responded with a status of 403 (Forbidden)
impersonate_logout.js?v=77537904fa2d3ea454b076ee2a6628dd:50 Uncaught TypeError: Cannot read property 'error' of undefined
    at Object.<anonymous> (impersonate_logout.js?v=77537904fa2d3ea454b076ee2a6628dd:50)
    at j (jquery.min.js:2)
    at Object.fireWith [as rejectWith] (jquery.min.js:2)
    at x (jquery.min.js:4)
    at XMLHttpRequest.<anonymous> (jquery.min.js:4)

cc @sharidas

@SergioBertolinSG
Copy link
Author

@pmaier1 please clarify if guest users should be able to being impersonated or not.

@PVince81
Copy link
Contributor

PVince81 commented Oct 9, 2017

I think it makes sense to allow impersonating guest users. This way an admin can find out what such user is actually seeing like what apps, visible folders, etc.

@pmaier1
Copy link
Contributor

pmaier1 commented Oct 9, 2017

This way an admin can find out what such user is actually seeing like what apps, visible folders, etc.

Well, an admin could also just create a "test guest". Anyway, impersonating guests should work as well, yes.

@SergioBertolinSG
Copy link
Author

Ok thanks.

@sharidas
Copy link
Contributor

@SergioBertolinSG Thanks for helping me setup the smtp setting for validating the issue. I guess the problem with logout is due to not whitelisting the impersonate app in the guest app setting:
guestapp_settings

When I whitelist impersonate app, the logout is working.

@SergioBertolinSG
Copy link
Author

Oh maybe that is why the guest user cannot impersonate anyone then.

@SergioBertolinSG
Copy link
Author

I think guest users should not be able to impersonate anyone.

It is possible to have the logout feature and not be able to impersonate as guest user?

@PVince81
Copy link
Contributor

The logout function needs to go to a special route when a user is impersonated, that special route is from the impersonate app. If the app is not whitelisted, I suspect that the special route will fail.

@SergioBertolinSG were you impersonating the guest user or is it just a simple "login" where the logout fails ?

@sharidas does the impersonate JS code load even when a user is not being impersonated ?

@SergioBertolinSG
Copy link
Author

@SergioBertolinSG were you impersonating the guest user or is it just a simple "login" where the logout fails ?

The logout fails when impersonating a guest user.

@sharidas
Copy link
Contributor

@PVince81 Yes the JS code is not loaded when the user is not being impersonated. And in the guest app case, it fails to load the JS code because impersonate app is not whitelisted ( by default ).

@PVince81
Copy link
Contributor

Hmm, that's a tricky situation then. We'd still need to somehow bypass the whitelist block to be able to load that one JS file.

@sharidas
Copy link
Contributor

Aah hold on... Sorry for stating that JS is not loaded. The JS impersonate_logout.js is loaded.. But the problem is accessing logoutcontroller.php. Need to think how to bypass the whitelist block...

@PVince81
Copy link
Contributor

Is there such a thing like a logout prehook ? If yes we could change the logic to listen to the prehook. If that works, you won't need to override the logout link any more and it would just go through the regular logout process, and call the impersonate logout part through the hook.

@sharidas
Copy link
Contributor

Couldn't find a logout prehook.

@sharidas
Copy link
Contributor

PR here: #68

@pmaier1
Copy link
Contributor

pmaier1 commented Nov 6, 2017

Moving to next version as we need to get a release out.

@pmaier1 pmaier1 modified the milestones: QA, development Nov 6, 2017
@PVince81
Copy link
Contributor

fixed through #68.

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