Hiding keyboard state

Keith Packard keithp at keithp.com
Mon Nov 30 20:42:47 PST 2015


Adam Jackson <ajax at nwnk.net> writes:

> On Mon, 2015-11-23 at 11:04 -0800, Keith Packard wrote:
>> One of the many security holes in X is that any application can monitor
>> the state of the keyboard device by querying the list of pressed keys on
>> a regular basis. Here's a simple patch which makes that request report
>> only key state which the client itself has already seen through X
>> events.
>> 
>> With this patch in place, grabbing the keyboard should be sufficient to
>> hide key presses from other clients.
>> 
>> I think we need to try to fix some of these issues, even if the fixes
>> break existing applications.
>
> Better unbefuckinglievably late than never.  This gets xterm's Secure
> Keyboard mode to be secure against xspy, which is nice.  If we're going
> to go down this path, we should also update the protocol spec to say
> it's a legal move for the implementation.

"as seen by the client by means of the protocol", which is part of the
spec for the QueryKeys request seems big enough to drive this through,
but yeah, explicit new wording seems like a good plan.

> I assume the offset here is because of the dumb "keys 0-7 don't really
> exist" bug, right?  If so,

Yes. I was hoping that was actually correct, and decided that I'd have
to write a program to verify it.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: querykey.c
Type: text/x-csrc
Size: 3680 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20151130/1cf0c721/attachment.c>
-------------- next part --------------

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20151130/1cf0c721/attachment.sig>


More information about the xorg-devel mailing list