-
-
Notifications
You must be signed in to change notification settings - Fork 637
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request from GHSA-rmq3-vvhq-gp32
See security advisory: GHSA-rmq3-vvhq-gp32 There are two security issues fixed by this change: 1. Access to NVDA python console and file explorer while on the lock screen. After opening and focusing the Windows Magnifier (and potentially other windows) from the `LockApp` (the lockscreen) NVDA no longer recognized that the lock screen was open. * To determine if NVDA is operating on the lock screen, it checked if the `LockApp` is the foreground window. * However, when the Magnifier has focus, the `LockApp` is not the foreground window. * The `LockApp` can still be open behind the magnifier, and should be preventing access to the logged in user's Windows profile. * If NVDA doesn't know that it is operating on the lock screen, it won't prevent access to tools that give access to the user's profile (E.G. NVDA python console) 2. Although not easy to reproduce, it was possible to report certain information about open applications from the lockscreen. * NVDA's `api` module is responsible for caching various system state used by NVDA, this is done through methods like `setForegroundObject`, `setFocusObject`, etc. * These methods rely on `_isSecureObjectWhileLockScreenActivated` to check if an object is permitted for use. * Secure objects are objects which are not intended to be available while Windows is locked. * These functions (`setForegroundObject`, `setFocusObject`, etc.) returned `True` if setting the object was a success and `False` otherwise. * However, consumers of these functions weren't observing the return value and the "secure objects" were used/reported even if the `setX` method in `api` failed. * It is no longer possible to run a python console from the lockscreen. * It is no longer possible to report information from below the lockscreen using object navigation. * `NVDAObjects` which fail to be set by the `api` module will not be read, and should be treated as if they do not exist by NVDA. * Considering security precautions has been added to PR templates. NVDA now determines if Windows is locked based on Windows Session notifications. https://docs.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsregistersessionnotification When locked: * A `LockApp` overlay class is applied to NVDA objects, to ensure they cannot read information on the desktop via object navigation. * Objects cannot be navigated to outside the active foreground process (i.e. visible on the lockscreen). * Only a whitelist of NVDA scripts/gestures are allowed. The `api` module functions which use `_isSecureObjectWhileLockScreenActivated` were identified: * `setNavigatorObject` * `setMouseObject` * `setFocusObject` * `setForegroundObject` Usages of these `api` functions were found and inspected. Ensured the return value is now observed; on failure to set the object, do not proceed to use the object. Additionally, as a precaution, other widely used functions that receive an `NVDAObject` have had protections added: * `getObjectPropertiesSpeech/getObjectSpeech` checks the object and now returns an empty speech sequence if it is secure. * Similar checks have been provided for eventHandler and braille objects. Finally, the task list / switcher (`alt+tab`) window needs to be explicitly added to an allow list for interaction while the lock screen is open because it does not does not become the foreground process on the lock screen. This makes it impossible to confirm that it is 'above' the lockscreen.
- Loading branch information
1 parent
6794032
commit d4de238
Showing
31 changed files
with
844 additions
and
261 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# A part of NonVisual Desktop Access (NVDA) | ||
# This file is covered by the GNU General Public License. | ||
# See the file COPYING for more details. | ||
# Copyright (C) 2022 NV Access Limited | ||
|
||
from typing import ( | ||
Optional | ||
) | ||
|
||
from NVDAObjects import NVDAObject | ||
|
||
|
||
class LockScreenObject(NVDAObject): | ||
""" | ||
Prevent users from object navigating outside of the lock screen. | ||
While usages of `_isSecureObjectWhileLockScreenActivated` in the api module prevent | ||
the user from moving to the object, this overlay class prevents reading neighbouring objects. | ||
""" | ||
|
||
def _get_next(self) -> Optional[NVDAObject]: | ||
nextObject = super()._get_next() | ||
if nextObject and nextObject.appModule.appName == self.appModule.appName: | ||
return nextObject | ||
return None | ||
|
||
def _get_previous(self) -> Optional[NVDAObject]: | ||
previousObject = super()._get_previous() | ||
if previousObject and previousObject.appModule.appName == self.appModule.appName: | ||
return previousObject | ||
return None | ||
|
||
def _get_parent(self) -> Optional[NVDAObject]: | ||
parentObject = super()._get_parent() | ||
if parentObject and parentObject.appModule.appName == self.appModule.appName: | ||
return parentObject | ||
return None |
This file contains 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
This file contains 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
Oops, something went wrong.
d4de238
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NVDA alpha-26228,33ee524f and later includes an important security fix.
The security problem can be prevented by disabling the Windows lock screen.
NV Access strongly recommends disabling the lock screen.
Instructions to disable the lock screen can be found in the workaround section in GHSA-rmq3-vvhq-gp32.
This security fix is planned to be released via 2022.2.1 and 2022.3beta3 on Wednesday 24th August around 0:01am UTC.
Ideally, security fixes are released straight to production.
Unfortunately, the patch for this security fix is quite complex.
Additionally, there are many Windows OS versions and many sign-in configurations for Windows, especially in corporate environments.
As such, we are aiming for a short period of alpha testing before releasing this patch.
Please start by "smoke testing" the build and report results here:
We want to know even if no problems are found so we can gauge the level of testing that this change has received.
Please report any security issues found via [email protected].
The diff for this work can be reviewed in this commit.
More details can be found in the GitHub advisory GHSA-rmq3-vvhq-gp32.
Thanks in advance,
NV Access Software Developers
d4de238
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.