Skip to content

Add theoretical security checks to every script available on the lock screen#14211

Merged
seanbudd merged 9 commits intomasterfrom
improve-reviewCursor-security-master
Nov 2, 2022
Merged

Add theoretical security checks to every script available on the lock screen#14211
seanbudd merged 9 commits intomasterfrom
improve-reviewCursor-security-master

Conversation

@seanbudd
Copy link
Member

@seanbudd seanbudd commented Oct 4, 2022

Link to issue number:

None

Summary of the issue:

NVDA may cache or directly access objects below the lock screen while Windows is locked.
As a result, without security checks, secure information may be leaked while Windows is locked.
"Secure objects" refer to NVDAObjects which may contain secure information: i.e. objects below the lock screen while Windows is locked.

In 2022.2.4, additional security checks were added to api.setReviewCursor to prevent secure objects from being set as the review cursor.
The results of api.setReviewCursor are not acknowledged, meaning theoretically a cached secure object may be announced.

Similar issues exist for other scripts available on the lock screen.
A thorough review of every script available on the lock screen is required.

There are no known exploits related to the theoretical issues that this PR attempts to solve.

Description of user facing changes

None

Description of development approach

A thorough review of every script available on the lock screen was performed.

Additional security checks were added to ensure that no secure objects or text from secure objects are cached or announced when activating a script available on the lock screen.

Testing strategy:

Test on alpha for an extensive period, as these changes are minor but widespread and hard to test manually.

Known issues with pull request:

None

Change log entries:

None required

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • Security precautions taken.

@seanbudd seanbudd requested a review from a team as a code owner October 4, 2022 05:10
@seanbudd seanbudd requested a review from feerrenrut October 4, 2022 05:10
@seanbudd seanbudd self-assigned this Oct 4, 2022
@seanbudd
Copy link
Member Author

seanbudd commented Oct 4, 2022

cc @CyrilleB79

@AppVeyorBot
Copy link

See test results for failed build of commit 72ed16feb5

Copy link
Contributor

@feerrenrut feerrenrut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good.

I didn't comment all changes, but it would be good to have an accurate log mesage when the scripts fail due to security. Additionally, for the user, it may be more friendly to supply a specific UI message.

Additionally, the consistency of the security explainer comments is good, perhaps link them all back to the set of safescripts.

@seanbudd seanbudd added the merge-early Merge Early in a developer cycle label Oct 10, 2022
@seanbudd seanbudd marked this pull request as draft October 10, 2022 10:17
@seanbudd seanbudd marked this pull request as ready for review October 14, 2022 04:23
@seanbudd seanbudd requested a review from feerrenrut October 14, 2022 04:23
@AppVeyorBot
Copy link

See test results for failed build of commit f4d9511645

Copy link
Contributor

@feerrenrut feerrenrut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's best to be explicit when that the script is expected to return after checking whether the info can be exposed. Trying to prevent future regressions by making the intent explicit.
I didn't mark all the cases where return in missing. It would be safest to ensure every ui.reviewMessage(gui.blockAction.Context.WINDOWS_LOCKED.translatedMessage) should be followed by a return, and if not comment on why a different pattern is followed.

# This script is available on the lock screen via getSafeScripts, as such
# ensure the status bar does not contain secure information
# before announcing this object
and not objectBelowLockScreenAndWindowsIsLocked(obj)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does the other branch handle a locked session? E.G. foreground = api.getForegroundObject(), will foreground be None?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested reporting the title on the lock screen. "Lock Screen Window" and "Magnifier" were reported correctly from the lock screen and sign-in screen. I'm not sure how gracefully this fails.

@feerrenrut feerrenrut marked this pull request as draft October 24, 2022 05:34
@seanbudd seanbudd marked this pull request as ready for review October 27, 2022 02:55
@seanbudd seanbudd requested a review from feerrenrut October 27, 2022 02:55
@seanbudd seanbudd merged commit b6c557a into master Nov 2, 2022
@seanbudd seanbudd deleted the improve-reviewCursor-security-master branch November 2, 2022 00:14
@nvaccessAuto nvaccessAuto added this to the 2023.1 milestone Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-early Merge Early in a developer cycle

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments