AppArmor doesn't block IPC - any program can act as a keylogger

Bug #1087064 reported by Madars
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
AppArmor
Fix Released
High
Unassigned

Bug Description

Problem: xinput can still read keystrokes addressed to other windows, even when presented an empty AppArmor profile (such as one attached).

How to test: copy xinput to /home/me/copy-of-xinput, launch it with "xinput list" to see ID for your primary keyboard, then do "xinput test <id>" and watch it register every keystroke (for example, those entered in sudo in neighboring terminal).

If I strace it, I can see that xinput succeeds opening /tmp/.X11-unix/X0 (an Unix socket), which should, by my understanding, be denied by the profile ("deny network"). The exact call sequence is:

socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC, 0) = 3
connect(3, {sa_family=AF_FILE, path=@"/tmp/.X11-unix/X0"}, 20) = 0
(followed by loads of recvfrom(3, ...) after poll() call)

I brought this up on #apparmor at OFTC and sarnold said that AppArmor currently doesn't handle IPC well.

Revision history for this message
Madars (madars) wrote :
Changed in apparmor:
status: New → Confirmed
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

AppArmor has IPC mediation of the form you describe in 2.9.

Changed in apparmor:
importance: Undecided → High
status: Confirmed → Fix Committed
milestone: none → 2.9.0
Revision history for this message
Steve Beattie (sbeattie) wrote :

Apparmor 2.9.0 has been released; closing.

Changed in apparmor:
status: Fix Committed → Fix Released
Revision history for this message
Dima (dima2017) wrote :

Why apparmor still doesn't block keylogging from the box? I've tried Lubuntu 18.04 LiveCD and the keylogging still works.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.