Skip to content

Commit b11ef9a

Browse files
authored
Merge 9088916 into b6fb039
2 parents b6fb039 + 9088916 commit b11ef9a

6 files changed

Lines changed: 82 additions & 25 deletions

File tree

include/espeak

Submodule espeak updated 163 files

miscDeps

source/api.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,17 +226,19 @@ def getReviewPosition() -> textInfos.TextInfo:
226226

227227

228228
def setReviewPosition(
229-
reviewPosition,
229+
reviewPosition: textInfos.TextInfo,
230230
clearNavigatorObject: bool = True,
231231
isCaret: bool = False,
232-
isMouse: bool = False,
233-
) -> None:
232+
isMouse: bool = False
233+
) -> bool:
234234
"""Sets a TextInfo instance as the review position.
235235
@param clearNavigatorObject: If True, it sets the current navigator object to C{None}.
236236
In that case, the next time the navigator object is asked for it fetches it from the review position.
237237
@param isCaret: Whether the review position is changed due to caret following.
238238
@param isMouse: Whether the review position is changed due to mouse following.
239239
"""
240+
if _isSecureObjectWhileLockScreenActivated(reviewPosition.obj):
241+
return False
240242
globalVars.reviewPosition=reviewPosition.copy()
241243
globalVars.reviewPositionObj=reviewPosition.obj
242244
if clearNavigatorObject: globalVars.navigatorObject=None
@@ -251,6 +253,7 @@ def setReviewPosition(
251253
else:
252254
visionContext = vision.constants.Context.REVIEW
253255
vision.handler.handleReviewMove(context=visionContext)
256+
return True
254257

255258

256259
def getNavigatorObject() -> NVDAObjects.NVDAObject:

source/screenExplorer.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import textInfos
99
import locationHelper
1010
import speech
11+
from utils.security import _isSecureObjectWhileLockScreenActivated
1112

1213
class ScreenExplorer(object):
1314

@@ -17,7 +18,16 @@ def __init__(self):
1718
self._obj=None
1819
self._pos=None
1920

20-
def moveTo(self,x,y,new=False,unit=textInfos.UNIT_LINE):
21+
# C901 'moveTo' is too complex
22+
# Note: when working on moveTo, look for opportunities to simplify
23+
# and move logic out into smaller helper functions.
24+
def moveTo( # noqa: C901
25+
self,
26+
x: int,
27+
y: int,
28+
new: bool = False,
29+
unit: str = textInfos.UNIT_LINE,
30+
) -> None:
2131
obj=api.getDesktopObject().objectFromPoint(x,y)
2232
prevObj=None
2333
while obj and obj.beTransparentToMouse:
@@ -55,11 +65,21 @@ def moveTo(self,x,y,new=False,unit=textInfos.UNIT_LINE):
5565
if pos and self.updateReview:
5666
api.setReviewPosition(pos)
5767
speechCanceled=False
58-
if hasNewObj:
68+
if hasNewObj and not _isSecureObjectWhileLockScreenActivated(obj):
5969
speech.cancelSpeech()
6070
speechCanceled=True
6171
speech.speakObject(obj)
62-
if pos and (new or not self._pos or pos.__class__!=self._pos.__class__ or pos.compareEndPoints(self._pos,"startToStart")!=0 or pos.compareEndPoints(self._pos,"endToEnd")!=0):
72+
if (
73+
pos
74+
and (
75+
new
76+
or not self._pos
77+
or pos.__class__ != self._pos.__class__
78+
or pos.compareEndPoints(self._pos, "startToStart") != 0
79+
or pos.compareEndPoints(self._pos, "endToEnd") != 0
80+
)
81+
and not _isSecureObjectWhileLockScreenActivated(pos.obj)
82+
):
6383
self._pos=pos
6484
if not speechCanceled:
6585
speech.cancelSpeech()

source/utils/security.py

Lines changed: 47 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,40 @@ def getSafeScripts() -> Set["scriptHandler._ScriptFunctionT"]:
2828
# and it might be needed by global maps.
2929
from globalCommands import commands
3030
return {
31+
# The focus object should not cache secure content
32+
# due to handling in `api.setFocusObject`.
3133
commands.script_reportCurrentFocus,
34+
35+
# Reports the foreground window.
36+
# The foreground object should not cache secure content
37+
# due to handling in `api.setForegroundObject`.
3238
commands.script_title,
39+
40+
# Reports system information that should be accessible from the lock screen.
3341
commands.script_dateTime,
3442
commands.script_say_battery_status,
43+
44+
# Mouse navigation is required to ensure controls
45+
# on the lock screen are accessible.
46+
# Preventing mouse navigation outside the lock screen
47+
# is handled using `api.setMouseObject` and `api.setNavigatorObject`.
48+
commands.script_moveMouseToNavigatorObject,
49+
commands.script_moveNavigatorObjectToMouse,
50+
commands.script_leftMouseClick,
51+
commands.script_rightMouseClick,
52+
53+
# Braille commands are safe, and required to interact
54+
# on the lock screen using braille.
55+
commands.script_braille_scrollBack,
56+
commands.script_braille_scrollForward,
57+
commands.script_braille_routeTo,
58+
commands.script_braille_previousLine,
59+
commands.script_braille_nextLine,
60+
61+
# Object navigation is required to ensure controls
62+
# on the lock screen are accessible.
63+
# Preventing object navigation outside the lock screen
64+
# is handled in `api.setNavigatorObject` and by applying `LockScreenObject`.
3565
commands.script_navigatorObject_current,
3666
commands.script_navigatorObject_currentDimensions,
3767
commands.script_navigatorObject_toFocus,
@@ -40,7 +70,13 @@ def getSafeScripts() -> Set["scriptHandler._ScriptFunctionT"]:
4070
commands.script_navigatorObject_next,
4171
commands.script_navigatorObject_previous,
4272
commands.script_navigatorObject_firstChild,
43-
commands.script_navigatorObject_devInfo,
73+
commands.script_navigatorObject_nextInFlow,
74+
commands.script_navigatorObject_previousInFlow,
75+
76+
# Moving the review cursor is required to ensure controls
77+
# on the lock screen are accessible.
78+
# Preventing review cursor navigation outside the lock screen
79+
# is handled in `api.setReviewPosition`.
4480
commands.script_review_activate,
4581
commands.script_review_top,
4682
commands.script_review_previousLine,
@@ -56,21 +92,16 @@ def getSafeScripts() -> Set["scriptHandler._ScriptFunctionT"]:
5692
commands.script_review_nextCharacter,
5793
commands.script_review_endOfLine,
5894
commands.script_review_sayAll,
59-
commands.script_braille_scrollBack,
60-
commands.script_braille_scrollForward,
61-
commands.script_braille_routeTo,
62-
commands.script_braille_previousLine,
63-
commands.script_braille_nextLine,
64-
commands.script_navigatorObject_nextInFlow,
65-
commands.script_navigatorObject_previousInFlow,
66-
commands.script_touch_changeMode,
67-
commands.script_touch_newExplore,
68-
commands.script_touch_explore,
69-
commands.script_touch_hoverUp,
70-
commands.script_moveMouseToNavigatorObject,
71-
commands.script_moveNavigatorObjectToMouse,
72-
commands.script_leftMouseClick,
73-
commands.script_rightMouseClick,
95+
96+
# Using the touch screen is required to ensure controls
97+
# on the lock screen are accessible.
98+
# Preventing touch navigation outside the lock screen
99+
# is handled in `screenExplorer.ScreenExplorer.moveTo`.
100+
commands.script_touch_changeMode, # cycles through available touch screen modes
101+
commands.script_touch_newExplore, # tap gesture, reports content under the finger
102+
commands.script_touch_explore, # hover gesture, reports content changes under the finger
103+
commands.script_touch_hoverUp, # hover up gesture, fixes a situation with touch typing
104+
# commands.script_touch_rightClick, TODO: consider adding, was this missed previously?
74105
}
75106

76107

user_docs/en/changes.t2t

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,14 @@ There are no deprecations proposed in 2022.3.
7070

7171

7272
= 2022.2.3 =
73-
This is a patch release to fix an accidental API breakage introduced in 2022.2.1.
73+
This is a patch release to fix a security issue.
74+
This release also fixes an accidental API breakage introduced in 2022.2.1.
7475

7576
== Bug Fixes ==
7677
- Fixed a bug where NVDA did not announce "Secure Desktop" when entering a secure desktop.
7778
This caused NVDA remote to not recognize secure desktops. (#14094)
79+
- Fixed an exploit where it was possible to open the NVDA python console via the log viewer on the lock screen.
80+
([GHSA-585m-rpvv-93qg https://github.com/nvaccess/nvda/security/advisories/GHSA-585m-rpvv-93qg])
7881
-
7982

8083
= 2022.2.2 =

0 commit comments

Comments
 (0)