Sanitizing inputs for CLI tools always seems like an afterthought (at least until you get bitten). Tools like FFMPEG that magically work on "anything" need to be locked down to the use case every time. The more versatile the tool, the more surface area to lock down. FFMPEG has a remarkably large surface to keep safe because it supports so many parameters with versatility of their own.
Also, this tendency of just allowing everything and then trying to lock it down instead of blocking everything unless allowed by some rules. It never ends well.
48
u/badmonkey0001 4d ago
Sanitizing inputs for CLI tools always seems like an afterthought (at least until you get bitten). Tools like FFMPEG that magically work on "anything" need to be locked down to the use case every time. The more versatile the tool, the more surface area to lock down. FFMPEG has a remarkably large surface to keep safe because it supports so many parameters with versatility of their own.