Polis: Prevent non-privileged accounts from accessing admin UI of all conversations

Created on 22 Jun 2020  ·  7Comments  ·  Source: compdemocracy/polis

This is mostly harmless, though a bit confusing, since there are unexpected errors when trying to interact with inputs.

Steps to Reproduce

  1. Sign up for a non-privleged account: https://pol.is/createuser
  2. Find a conversation you are only a participant in, e.g., https://pol.is/3ntrtcehas
  3. Change the url to access the admin interface: https://pol.is/m/3ntrtcehas

Observed Behavior

Expected Behavior

Wouldn't have access to admin pages.

priority-★★★ 🐛 bug client-admin

Most helpful comment

A little community +1 on this - to raise another potential harm here, this might lead to disclosure of sensitive personal data where it's been entered by participants and rejected by moderators (e.g. we've seen participants plonking their email addresses into the statement submit bar.)

As you can't currently delete these comments through the admin interface (right?) closing this issue would deal with a potential data breach

All 7 comments

https://gitter.im/pol-is/polisDeployment?at=5efccfa8b8152d34847637da

@colinmegill: I would try to go after the loading states and check the consoles. If it’s actually ‘unauthorized’ then what it really is is an unhandled error on monitor view, and then simply correct that there, redirect on the client to login, and figure out why the same pattern isn’t applied on configure view. Sounds like the create report page may be doing something in the right direction

A little community +1 on this - to raise another potential harm here, this might lead to disclosure of sensitive personal data where it's been entered by participants and rejected by moderators (e.g. we've seen participants plonking their email addresses into the statement submit bar.)

As you can't currently delete these comments through the admin interface (right?) closing this issue would deal with a potential data breach

Agree, @joshsmith2, I'd like to have a fix in for this this week.

I did a little poking around, and a line of investigation involves some components where an error prop exists, and does some checks as if it's expecting an object to be passed (e.g., this.props.error.status == 401) but it seems that the reducers was later refactored and now passes error as a boolean, and a separate status prop with the error.status value.

Will investigate more later

EDIT: the reducer is related to user data, so that's a good sign

This is with the change suggested in the above msg.

Accessing conversation I do NOT moderate

Ok, so when I re-enable that commented out line, it works pretty well for a conversation I shouldn't have access to:

screencast

Access conversation I DO moderate

But interestingly, now I get the same redirect when trying to make any change to a convo I do own. Not that I get redirected only on save, and the save still "takes".

screencast

When inspecting component props in browser using react devtools, seems that on saving, the is_mod and is_owner keys disappear from zid_metadata for some reason...
Screen Shot 2020-07-13 at 5 25 13 PM

Was this page helpful?
0 / 5 - 0 ratings

Related issues

crkrenn picture crkrenn  ·  7Comments

colinmegill picture colinmegill  ·  6Comments

patcon picture patcon  ·  9Comments

patcon picture patcon  ·  10Comments

colinmegill picture colinmegill  ·  6Comments