Clear state upon logging out. #144

Closed
yrammos wants to merge 0 commits from clear-state into master
yrammos commented 2020-06-18 17:19:18 +02:00 (Migrated from github.com)

@babelouest I'm submitting this PR tentatively—feel free to close, delete, or continue the discussion via a private channel.

A proper log-out view is in the works, as we both know, and this will eliminate once and for all the possibility of private data remaining visible on the screen after logging out.

From a security point of view, though, hiding things from view is likely not enough. An intuitively and formally trustworthy pattern for deleting all potentially private data from this.state would provide additional piece of mind. I think a Redux developer (which I'm not) would use "reducers" for doing this reliably.

In a typical React pattern, where statefulness is tightly controlled, this is not difficult to do. Yet state ownership in Glewlwyd is distributed among components. So each component should probably provide reasonable "proof" that it has cleaned after itself whenever a user logs out. I realize that this is mostly done already—mostly, but not always, and sometimes it is hard to tell (e.g. with schemes/plugins).

The PR is meant to raise the issue. It proposes that componentWillReceiveProps() might (?) be a suitable place for zeroing-out state values in an accountable way ("accountable" in the sense that any state values not reset within componentWillReceiveProps may not be safely assumed reset upon logging out).

In the longer run, one would probably take measures against browser caching and "forward-backward" browser navigation, e.g. by using React Router.

@babelouest I'm submitting this PR tentatively—feel free to close, delete, or continue the discussion via a private channel. A proper log-out view is in the works, as we both know, and this will eliminate once and for all the possibility of private data remaining visible on the screen after logging out. From a security point of view, though, hiding things from view is likely not enough. An intuitively and formally trustworthy pattern for deleting all potentially private data from `this.state` would provide additional piece of mind. I think a Redux developer (which I'm not) would use "reducers" [for doing this reliably](https://netbasal.com/how-to-secure-your-users-data-after-logout-in-redux-30468c6848e8). In a typical React pattern, where statefulness is tightly controlled, this is not difficult to do. Yet state ownership in Glewlwyd is distributed among components. So each component should probably provide reasonable "proof" that it has cleaned after itself whenever a user logs out. I realize that this is mostly done already—mostly, but not always, and sometimes it is hard to tell (e.g. with schemes/plugins). The PR is meant to raise the issue. It proposes that `componentWillReceiveProps()` *might* (?) be a suitable place for zeroing-out state values in an accountable way ("accountable" in the sense that any state values not reset within `componentWillReceiveProps` may not be safely assumed reset upon logging out). In the longer run, one would probably take measures against browser caching and "forward-backward" browser navigation, e.g. by using React Router.
babelouest commented 2020-06-18 19:36:26 +02:00 (Migrated from github.com)

Thanks @yrammos for the pull request, although as I told you, I already started some work in the logout-screen branch, I'd like to concentrate the logging out work on this branch if you don't mind, it'll be easier.

Thanks @yrammos for the pull request, although as I told you, I already started some work in the [logout-screen branch](https://github.com/babelouest/glewlwyd/tree/logout-screen), I'd like to concentrate the logging out work on this branch if you don't mind, it'll be easier.
yrammos commented 2020-06-18 19:39:47 +02:00 (Migrated from github.com)

Sure enough, @babelouest, this is meant as a bookmark for future discussion. Feel free to close as you see fit. Will look at your log out branch shortly.

Sure enough, @babelouest, this is meant as a bookmark for future discussion. Feel free to close as you see fit. Will look at your log out branch shortly.
babelouest commented 2020-06-18 19:44:39 +02:00 (Migrated from github.com)

@yrammos , if possible, backport this pull request in the new branch if you like

@yrammos , if possible, backport this pull request in the new branch if you like
yrammos commented 2020-06-18 21:35:53 +02:00 (Migrated from github.com)

@babelouest, back-ported as #145.

@babelouest, back-ported as #145.

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
KittenSquad/glewlwyd!144
No description provided.