Bug 1204421

Summary: LXDE Desktop user security
Product: [Fedora] Fedora Reporter: Mohan G <mohancloudworld>
Component: xorg-x11-serverAssignee: X/OpenGL Maintenance List <xgl-maint>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 22CC: me, xgl-maint
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-19 19:06:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mohan G 2015-03-21 21:33:50 UTC
Description of problem:
I recently realized that any user remotely logged-in to a linux LXDE machine as non-sudo user via SSH, can capture/view the desktop of the any other user who is using the GUI.

Version-Release number of selected component (if applicable):
Fedora LXDE: 20 & 21

How reproducible: 
100%

Steps to Reproduce:
1. Install Fedora using Fedora-Live-LXDE-x86_64-20-1.iso
2. YUM Update it
3. Add a non-sudo user. [Assuming a sudo user already exists]
4. With rpmfusion-free repository, installed ffmpeg and vlc
5. Start SSH-Daemon
6. From any other machine, log-in into this machine as a non-sudo user via SSH
7. Using ffmpeg's x11grab, this non-sudo user can remotely capture the desktop screen of any user currently using the GUI (it should be active i.e., in unlocked state).

Actual results:
A non-sudo user remotely logged-in can capture the desktop of any user using the GUI.

Expected results:
User should not be able to capture any other user's desktop except his own.

Additional info:
1. Command used to capture:
ffmpeg -f x11grab -r 60 -s $(xwininfo -display :0 -root | awk '/geometry/ {print $2}' | cut -d+ -f1) -i :0.0 -qscale 0 output.mp4

2.  I have not changed any setting like "xhost", "xauth" or anything else.

Comment 1 Mohan G 2015-03-23 07:31:49 UTC
Here is the log
$ ssh guestuser.122.225
guestuser.122.225's password: 
[guestuser@localhost ~]$ echo $DISPLAY

[guestuser@localhost ~]$ echo $DESKTOP_SESSION

[guestuser@localhost ~]$ cat ~/.Xauthority
cat: /home/guestuser/.Xauthority: No such file or directory
[guestuser@localhost ~]$ xhost
xhost:  unable to open display ""
[guestuser@localhost ~]$ cat /etc/sysconfig/desktop
PREFERRED=/usr/bin/startlxde
DISPLAYMANAGER=/usr/sbin/lxdm
[guestuser@localhost ~]$ cat /etc/redhat-release 
Fedora release 20 (Heisenbug)
[guestuser@localhost ~]$ who
mohan    pts/0        2015-03-23 02:13 (:0)
guestuser pts/1        2015-03-23 02:15 (192.168.122.1)
[guestuser@localhost ~]$ ffmpeg -f x11grab -r 60 -s $(xwininfo -display :0 -root | awk '/geometry/ {print $2}' | cut -d+ -f1) -i :0.0 -qp 0 output.mp4
ffmpeg version 2.1.7 Copyright (c) 2000-2014 the FFmpeg developers
  built on Jan  3 2015 22:57:36 with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-7)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-frei0r --enable-gnutls --enable-libass --enable-libcdio --enable-libcelt --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
  libavutil      52. 48.101 / 52. 48.101
  libavcodec     55. 39.101 / 55. 39.101
  libavformat    55. 19.104 / 55. 19.104
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.100 /  3. 90.100
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
[x11grab @ 0x1c36fe0] device: :0.0 -> display: :0.0 x: 0 y: 0 width: 1024 height: 768
[x11grab @ 0x1c36fe0] shared memory extension found
Input #0, x11grab, from ':0.0':
  Duration: N/A, start: 1427095023.017106, bitrate: 1509949 kb/s
    Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1024x768, 1509949 kb/s, 60 tbr, 1000k tbn, 60 tbc
[swscaler @ 0x1c382e0] deprecated pixel format used, make sure you did set range correctly
No pixel format specified, yuv444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x1c6c2a0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x1c6c2a0] profile High 4:4:4 Predictive, level 3.2, 4:4:4 8-bit
[libx264 @ 0x1c6c2a0] 264 - core 138 r2363 c628e3b - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=0 mixed_ref=1 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=0 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc=cqp mbtree=0 qp=0
Output #0, mp4, to 'output.mp4':
  Metadata:
    encoder         : Lavf55.19.104
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv444p, 1024x768, q=-1--1, 15360 tbn, 60 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo -> libx264)
Press [q] to stop, [?] for help
frame= 1204 fps= 58 q=-1.0 Lsize=    3556kB time=00:00:20.06 bitrate=1451.9kbits/s    
video:3551kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.155689%
[libx264 @ 0x1c6c2a0] frame I:5     Avg QP: 0.00  size:406844
[libx264 @ 0x1c6c2a0] frame P:1199  Avg QP: 0.00  size:  1336
[libx264 @ 0x1c6c2a0] mb I  I16..4: 25.5%  4.0% 70.4%
[libx264 @ 0x1c6c2a0] mb P  I16..4:  0.1%  0.1%  0.1%  P16..4:  0.2%  0.2%  0.1%  0.0%  0.0%    skip:99.3%
[libx264 @ 0x1c6c2a0] 8x8 transform intra:14.1% inter:45.6%
[libx264 @ 0x1c6c2a0] coded y,u,v intra: 70.0% 61.6% 61.7% inter: 0.2% 0.2% 0.2%
[libx264 @ 0x1c6c2a0] i16 v,h,dc,p: 52% 47%  1%  0%
[libx264 @ 0x1c6c2a0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 28% 63%  8%  0%  0%  0%  0%  0%  0%
[libx264 @ 0x1c6c2a0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 34% 37%  9%  3%  4%  3%  3%  2%  4%
[libx264 @ 0x1c6c2a0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x1c6c2a0] ref P L0: 76.5%  1.1% 13.4%  9.0%
[libx264 @ 0x1c6c2a0] kb/s:1449.38

Comment 2 Fedora End Of Life 2015-05-29 13:45:34 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 3 Fedora End Of Life 2015-06-30 00:16:26 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 4 Mohan G 2015-07-01 00:09:14 UTC
This issue exists even in Fedora-22, installed using Fedora-Live-LXDE-x86_64-22-3.iso

Comment 5 Pete Travis 2015-08-18 13:40:01 UTC
This is symptomatic of a package *on* the live image, and not particularly the live image itself.  I don't have a good grasp of the mechanisms ffpeg is using, but the Xorg maintainers might.  Reassigning for further guidance.

Comment 6 Fedora End Of Life 2016-07-19 19:06:26 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.