Skip to content
  • Rémi Denis-Courmont's avatar
    record: protect against arbitrary file overwrite · 0c166ad1
    Rémi Denis-Courmont authored
    Setting the no-overwrite flag of the file access output ensures that
    record will not indirectly trigger overwriting of an unintended file.
    
    There are two occurences to this problem:
    
    - While probing the muxer format, VLC uses the notoriously insecure and
      obsolescent (in POSIX.2008) tempnam() function. This leads to an
      arbitrary file overwrite vulnerability via symbolic links.
      However, the record plugin really should not need to create temporary
      files to probe a muxer format.
    
    - While actually recording content to a permanent file, overwriting an
      existing file is not a good idea. This is presumably not a
      vulnerability insofar as the output directory belongs to the user.
      Regardless, the record plugin should ensure that the output filename
      does not already exists (e.g. by creating the file).
    
    So basically, this is a stopgap measure.
    0c166ad1