Secure Programming for Linux and Unix HOWTO
Prev | Chapter 5. Validate All Input | Next

# 5.5. File Contents

If a program takes directions from a file, it must not trust that file specially unless only a trusted user can control its contents. Usually this means that an untrusted user must not be able to modify the file, its directory, or any of its ancestor directories. Otherwise, the file must be treated as suspect.

If the directions in the file are supposed to be from an untrusted user, then make sure that the inputs from the file are protected as describe throughout this book. In particular, check that values match the set of legal values, and that buffers are not overflowed.

Prev | Home | Next
File Names | Up | Web-Based Application Inputs (Especially CGI Scripts)