Summary: | XQueryKeymap() bypasses security-sensitive keyboard grabs | ||||||
---|---|---|---|---|---|---|---|
Product: | xorg | Reporter: | Daniel Richard G. <skunk> | ||||
Component: | Server/Input/Core | Assignee: | Xorg Project Team <xorg-team> | ||||
Status: | RESOLVED WONTFIX | QA Contact: | Xorg Project Team <xorg-team> | ||||
Severity: | enhancement | ||||||
Priority: | medium | CC: | peter.hutterer, xorg_security | ||||
Version: | unspecified | ||||||
Hardware: | x86-64 (AMD64) | ||||||
OS: | Linux (All) | ||||||
Whiteboard: | |||||||
i915 platform: | i915 features: | ||||||
Attachments: |
|
Description
Daniel Richard G.
2013-05-09 20:35:43 UTC
There is no such thing as a secure keyboard grab, and never has been. The labeling of the xterm menu item as "secure keyboard" was a bug in xterm that was fixed a number of years ago (bug #379 here). Any application thinking that grabbing the keyboard provides security is mistaken and buggy. The ability of XQueryKeymap to see keyboard state was known well before 1997, as it was covered in the "Analysis of the X Protocol for Security Concerns" published in 1996: http://www.x.org/releases/X11R7.7/doc/xorg-docs/Xserver/analysis.html had proof of concept code published in 1995: http://web.archive.org/web/20010803132807/http://www.acm.vt.edu/~jmaxwell/programs/xspy/xspy.html and a solution was provided in the X Security extension in 1996: http://www.x.org/releases/X11R7.7/doc/xextproto/security.html#Keyboard_Security I'm tempted to simply close this as not a bug, as it's a long documented limitation of the X11 protocol, with an extension already provided to fix, but will leave it open for now for other X developers to chime in. Do you know of any existing apps using the X Security extension to protect keyboard input? I haven't seen any reference to this animal before. (I recognize that XGrabKeyboard() is not advertised as providing a secure input path, which is why I filed this as an enhancement rather than a bug.) I guess XACE is a useful reference to add here too: http://www.x.org/releases/X11R7.5/doc/security/XACE-Spec.html I'm closing this as WONTFIX. Don't take this as "we don't want this", read this as "we will never have the time to implement this", so we might as well shatter any hopes now before someone gets too attached to the idea. The only app I know of that uses the X security extension is OpenSSH, but many users disable the security as being too painful. (In reply to comment #4) > The only app I know of that uses the X security extension is OpenSSH, but > many users disable the security as being too painful. I see this has to do with the distinction between OpenSSH's -X and -Y options (and despite my expectation, nothing to do with the bundled gnome-ssh-askpass program). This thread has some more information, but little of it is positive: http://lists.freedesktop.org/archives/xdg/2008-December/010104.html (In reply to comment #3) > I guess XACE is a useful reference to add here too: > http://www.x.org/releases/X11R7.5/doc/security/XACE-Spec.html Which appears to be what SELinux uses. > I'm closing this as WONTFIX. Don't take this as "we don't want this", read > this as "we will never have the time to implement this", so we might as well > shatter any hopes now before someone gets too attached to the idea. Well, at least now, this is documented :-) I'm not surprised; an issue old enough to buy cigarettes probably didn't get that way by escaping notice. Just so that I understand: Is it that implementing Daniel Stone's suggested fix would be in itself non-trivial, or that plugging up all the avenues that a keylogger could use in the X API would be a wild-goose chase, or what? Hypothetically speaking, if someone wanted to patch up ssh-askpass or the like to better protect against keyloggers, would it make architectural sense to develop a small XACE-based extension that can then be used by such programs? (The idea I've heard tossed around to provide secure password entry is to start up a second X server, switch VT, show the dialog, then exit and switch back---giving a UI experience not unlike the Ctrl-Alt-Delete dialog in Microsoft Windows. It would be nice if there were a more lightweight approach that would yield a comparable degree of security.) |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.