[FFmpeg-trac] #11247(ffmpeg:new): Sensitive info passed on command line may unexpectedly leak

FFmpeg trac at avcodec.org
Mon Oct 21 07:06:14 EEST 2024


#11247: Sensitive info passed on command line may unexpectedly leak
---------------------------------------+----------------------------------
             Reporter:  rayanayar      |                    Owner:  (none)
                 Type:  enhancement    |                   Status:  new
             Priority:  normal         |                Component:  ffmpeg
              Version:  unspecified    |               Resolution:
             Keywords:  password rtsp  |               Blocked By:
             Blocking:                 |  Reproduced by developer:  0
Analyzed by developer:  0              |
---------------------------------------+----------------------------------
Comment (by rayanayar):

 Yes, ffmpeg can't change OS behavior.
 But ffmpeg can solve this.
 Like other programs, which can get sensitive info from files or envvars.

 For example, Curl and Wget use ".netrc" (.wgetrc) file, where stored all
 sensitive data.

 When mounting samba share...
 user/pass can be passed from command line (which is vulnerable to "ps"):
 {{{
 mount -t cifs -o user=user,pass=arg ...
 }}}
 or from file:
 {{{
 mount -t cifs -o credentials=./secret.cred ...
 }}}
 or from envvar:
 {{{
 USER="alice" PASSWD="12345" mount -t cifs ...
 }}}

 Also ffmpeg could get "input" from envvar, for example by filter:
 {{{
 INPUT='rtsp://admin:PASSWORD@192.168.0.100/stream1'
 ffmpeg \
   -t 3600 \
   -f envvar -i INPUT \
   -vcodec copy -acodec copy "$(date +%Y-%m-%d+%H-%M-%S).mkv"
 }}}
 Filter "envvar" tells get input from specified variable name.
 This will be enough to protect from "ps".
 I guess this filter will be simple to implement.
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/11247#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list