This repository was archived by the owner on Apr 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
Bugfix/#1072 NotificationSettingsController vulnerabilities #1080
Merged
torss
merged 23 commits into
develop
from
bugfix/#1072-NotificationSettingsController-vulnerabilities
Dec 20, 2018
Merged
Bugfix/#1072 NotificationSettingsController vulnerabilities #1080
torss
merged 23 commits into
develop
from
bugfix/#1072-NotificationSettingsController-vulnerabilities
Dec 20, 2018
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…-NotificationSettingsController-vulnerabilities # Conflicts (resolved): # api/test/controllers/TestNotificationController.ts
This fixes the arbitrary id request vulnerability that enabled anyone to read everyone else's notification settings. Merely minor front-end changes were required, since the route is only used to get the current user's settings anyway.
This is primarily meant to close the vulnerabilities that the unfiltered toObject responses caused (i.e. full data leakage of course (& user) data), but it also changes the PutNotificationSettings route to use the @currentuser instead of an arbitrary user, since INotificationSettingsView doesn't contain the user field any longer (but this alone does not yet fully secure the request side of that route).
- It now uses clearly defined `@BodyParam`s. - Instead of requiring an explicit ID, it now simply utilizes the given `course` & `@CurrentUser` to identify the settings. - `upsert` is now enabled, so that the route should be capable of completely replacing the functionality of createNotificationSettings too (but for that further code changes are necessary).
This simplification is possible because there can only be one NotificationSettings document per user/course pair anyway.
Because the front-end no longer needs the response info.
notificationSettingsService.updateItem(settings) didn't work because it automatically appends the updateItem._id to the this.apiPath, while the notification settings routes currently don't need any IDs at all.
…-NotificationSettingsController-vulnerabilities
kesselb
approved these changes
Dec 20, 2018
…er-vulnerabilities
…ties' of https://github.com/geli-lms/geli into bugfix/#1072-NotificationSettingsController-vulnerabilities
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
api
All Backend related Issues
bug
This Issue describes a unwanted behavior
refactoring
🔒 security
This directly pertains to geli's security!
web-frontend
All frontend related issues
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Closes #1072
Fixes the data leaks (full
course&userleakage due totoObject) and access vulnerabilities of the threeNotificationSettingsControllerroutes. It simultaneously refactors the routes "severely", see below.Improvements
toObject-based data leaks a newINotificationSettingsViewinterface is introduced. It only contains thecourseID besides the actual settings (notificationType&emailNotification). I.e. notification settings aren't even identified via their own internal IDs anymore, since a@CurrentUser&coursepair is sufficient.POSTroute was completely removed since it is obviated by the upgradedPUTroute, which now hasupsertenabled (among other refactoring and changes relating toINotificationSettingsView).PUTcourse), minimizing the attack surface. Instead the@CurrentUseris utilized etc. (This together withINotificationSettingsViewresponses securesGETcompletely.)PUTroute now handles404errors, i.e. when thecoursecan't be found (+ new unit test).PUTroute also checks that the@CurrentUseris authorized to at least view thecourse(+ new unit test), although this is no longer strictly necessary from a security viewpoint due to the reduced attack surface.NotificationSettingsControllerunit test refactoring in general.NotificationSettings.tsfront-end class file is removed.Known Issues:
NONE