Input Output (FIO)
- FIO01-C. Be careful using functions that use file names for identification
- FIO02-C. Canonicalize path names originating from tainted sources
- FIO03-C. Do not make assumptions about fopen() and file creation
- FIO05-C. Identify files using multiple file attributes
- FIO06-C. Create files with appropriate access permissions
- FIO08-C. Take care when calling remove() on an open file
- FIO09-C. Be careful with binary data when transferring data across systems
- FIO10-C. Take care when using the rename() function
- FIO11-C. Take care when specifying the mode parameter of fopen()
- FIO13-C. Never push back anything other than one read character
- FIO14-C. Understand the difference between text mode and binary mode with file streams
- FIO15-C. Ensure that file operations are performed in a secure directory
- FIO17-C. Do not rely on an ending null character when using fread()
- FIO18-C. Never expect fwrite() to terminate the writing process at a null character
- FIO19-C. Do not use fseek() and ftell() to compute the size of a regular file
- FIO20-C. Avoid unintentional truncation when using fgets() or fgetws()
- FIO21-C. Do not create temporary files in shared directories
- FIO22-C. Close files before spawning processes
- FIO23-C. Do not exit with unflushed data in stdout or stderr
- FIO24-C. Do not open a file that is already open
Information for Editors
To have a new guideline automatically listed above be sure to label it fio and recommendation .
Risk Assessment Summary
| Rule | Severity | Likelihood | Detectable | Repairable | Priority | Level |
|---|---|---|---|---|---|---|
| FIO01-C | Medium | Likely | Yes | No | P12 | L1 |
| FIO02-C | Medium | Probable | No | No | P4 | L3 |
| FIO03-C | Medium | Probable | No | No | P4 | L3 |
| FIO05-C | Medium | Probable | No | No | P4 | L3 |
| FIO06-C | Medium | Probable | No | No | P4 | L3 |
| FIO08-C | Medium | Probable | No | No | P4 | L3 |
| FIO09-C | Medium | Probable | No | No | P4 | L3 |
| FIO10-C | Medium | Probable | No | No | P4 | L3 |
| FIO11-C | Medium | Probable | No | No | P4 | L3 |
| FIO13-C | Medium | Probable | No | No | P4 | L3 |
| FIO14-C | Low | Probable | No | No | P2 | L3 |
| FIO15-C | Medium | Probable | No | No | P4 | L3 |
| FIO17-C | Low | Likely | No | Yes | P6 | L2 |
| FIO18-C | Medium | Probable | No | No | P4 | L3 |
| FIO19-C | Low | Unlikely | Yes | Yes | P3 | L3 |
| FIO20-C | Medium | Likely | No | Yes | P12 | L1 |
| FIO21-C | Medium | Probable | No | No | P4 | L3 |
| FIO22-C | Medium | Unlikely | No | No | P2 | L3 |
| FIO23-C | Medium | Unlikely | No | Yes | P4 | L3 |
| FIO24-C | Medium | Probable | No | No | P4 | L3 |


