SECURITY: Sanitize shell command args

Add validation and sanitization to several code paths.


Bug: 60339
Change-Id: Id124281d21ec730a2e0bbace843dd97194a712b4