Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logon screen can be bypassed using various shortcuts #28

Closed
N0rbert opened this issue Oct 22, 2021 · 10 comments
Closed

Logon screen can be bypassed using various shortcuts #28

N0rbert opened this issue Oct 22, 2021 · 10 comments

Comments

@N0rbert
Copy link

N0rbert commented Oct 22, 2021

Original bug-report was reported at https://pad.lv/1948339 about Ubuntu MATE 21.10. Previous releases like 20.10 and 21.04 are affected too.

The essence of the above bug-report:

It turns out that several keyboard shortcuts are allowed while Ubuntu Mate is locked (arctica-greeter):

  • Mod4 + S (mate-search-tool)
  • Mod4 + E (Open Caja / File Explorer)
  • CTRL + Shift + Esc (mate-system-monitor)
  • PRNT (Screenshot)

All of the mentioned shortcuts could be used to spawn a file explorer (Caja) or various other binaries as user "lightdm", who owns the logon screen.

Although an interactive terminal like mate-terminal, xterm, lxterm etc. could not be opened directly, there are various options to run commands as the lightdm user, for example by creating a shell script using "caja", and execute it directly using the GUI.

I've attached Proof-of-Concept GIFs for all shortcuts mentioned above. There might be additional shortcuts that could be used to achieve the same, however I'm not aware about every shortcut that is configured, but I suppose that the root cause is located somewhere in arctica-greeter, rather than within every single binary launched by shortcuts.

The bug was reproduced on a fresh installation of Ubuntu Mate 21.10.

Please find additional version details below:

$ apt-cache policy lightdm

lightdm:
Installed: 1.30.0-0ubuntu4
Candidate: 1.30.0-0ubuntu4
Version table:
*** 1.30.0-0ubuntu4 500
500 http://de.archive.ubuntu.com/ubuntu impish/universe amd64 Packages
100 /var/lib/dpkg/status

$ apt-cache policy arctica-greeter

arctica-greeter:
Installed: 0.99.1.5-2nmu1
Candidate: 0.99.1.5-2nmu1
Version table:
*** 0.99.1.5-2nmu1 500
500 http://de.archive.ubuntu.com/ubuntu impish/universe amd64 Packages
100 /var/lib/dpkg/status

Thanks,
Basti

@N0rbert
Copy link
Author

N0rbert commented Oct 22, 2021

Bug about lightdm is here - canonical/lightdm#214 .

@bka-dev
Copy link
Contributor

bka-dev commented Dec 24, 2021

Good evening all,

took a while to narrow down the reason why keybindings are accepted at all.

Turns out, that arctica-greeter is invoking an instance of the "marco" window manager that contains an event listener for any configured/hardcoded marco keybindings.

These are usually stored by dconf at location /org/mate/marco/global-keybindings/

The invocation of marco was introduced with 9b3526d on Jun 16, 2018 and released with arctica-greeter 0.99.1.1 on Feb 6, 2019.

Since I don't know the inner workings of arctica-greeter and ayatana-indicators in combination with marco, I'm not providing a fix here. However it looks like the invocation of marco was only introduced for usability reasons, as per the ChangeLog ("Makes handling windows opened via some of the indicators much more organic"), so it probably wouldn't break anything if the added code parts would be removed.
Hope this helps.

Cheers,
Basti

@bka-dev
Copy link
Contributor

bka-dev commented Feb 28, 2022

I removed most of the code that was introduced with 9b3526d in #30 .

Compiled and installed in a VM running Ubuntu Mate 21.10. Seems to work quite well, but please double check.

@uli42
Copy link
Member

uli42 commented Feb 28, 2022 via email

@bka-dev
Copy link
Contributor

bka-dev commented Feb 28, 2022

It seems like marco also ships "marco-message" that is able to send commands to the marco daemon.

It could be invoked like marco-message disable-keybindings to disable keybindings.

However this still leaves a tiny time window during which key bindings are allowed, since marco needs to be invoked first. I did not find any command line switch yet that would start marco without keybindings. Also i don't know for sure how two subsequent invocations of Process.spawn_async would behave in terms of race-conditions etc.

Doesn't feel like a very elegant solution to me

sunweaver added a commit to sunweaver/arctica-greeter that referenced this issue Mar 28, 2022
sunweaver added a commit to sunweaver/arctica-greeter that referenced this issue Mar 28, 2022
…e option.

 This requires a very recent version of marco, see [1].

 Fixes ArcticaProject#28.

 [1] mate-desktop/marco#723
sunweaver added a commit to sunweaver/arctica-greeter that referenced this issue Apr 1, 2022
…e option.

 This requires a very recent version of marco, see [1].

 Fixes ArcticaProject#28.

 [1] mate-desktop/marco#723
sunweaver added a commit to sunweaver/arctica-greeter that referenced this issue Apr 1, 2022
…e option.

 This requires a very recent version of marco, see [1].

 Fixes ArcticaProject#28.

 [1] mate-desktop/marco#723
@bka-dev
Copy link
Contributor

bka-dev commented Apr 25, 2022

Hi all,

the implemented fix worked fine for marco.

Actually I just discovered another issue, affecting "mate-settings-daemon" this time (also mentioned on Launchpad.

I installed MATE 22.04 on another system with some special keys on the keyboard and one of the keys (Fn + F9) on the connected keyboard is launching "mate-search-tool". I did some further research and noticed that this time different component is affected: mate-settings-daemon.

When I terminated mate-settings-daemon via SSH connection, the keybinding was no longer accepted.

20.04.3 does not seem to be affected, as slick-greeter is not relying on mate-settings-daemon. So it's probably 20.10 up to 22.04.

I will add a separate issue within the arctica-greeter project.

Not sure what the best fix is - either something similar like "marco --no-keybindings", or by not invoking mate-settings-daemon at all, although I guess this could break some ayatana-indicators features.

@sunweaver
Copy link
Member

This issue has probably been resolved via 0199f9a

Please check and provide feedback, if issues like those observed still exist with that patch applied (and the rfkill follow-up).

@bka-dev
Copy link
Contributor

bka-dev commented Dec 28, 2022

Pulled a current copy of the arctica-greeter repo, compiled it, and installed it on a fresh Ubuntu MATE 22.10 installation.

The issue still exists.

I could use the keybinding "Fn"-Key + F9 to open "mate-search-tool". My keyboard has a little search icon, printed on the F9 key.

@bka-dev
Copy link
Contributor

bka-dev commented Feb 27, 2023

Good evening @sunweaver ,

were you able to reproduce the issue as well? It currently only affects special keybindings like those on specially labelled keys.

@sunweaver
Copy link
Member

Finally amended via 7a865a1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants