01.07.2016 Views

SEI CERT C Coding Standard

tqcylJ

tqcylJ

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Input/Output (FIO) - FIO32-C. Do not perform operations on devices that are only appropriate for files<br />

}<br />

*/<br />

if (0 == _stricmp(path, reserved[i])) {<br />

ret = true;<br />

}<br />

}<br />

return ret;<br />

10.2.5 Risk Assessment<br />

Allowing operations that are appropriate only for regular files to be performed on devices can result<br />

in denial-of-service attacks or more serious exploits depending on the platform.<br />

Rule Severity Likelihood Remediation Cost Priority Level<br />

FIO32-C Medium Unlikely Medium P4 L3<br />

10.2.6 Related Guidelines<br />

<strong>CERT</strong> C Secure <strong>Coding</strong> <strong>Standard</strong><br />

FIO05-C. Identify files using multiple file attributes<br />

FIO15-C. Ensure that file operations are performed<br />

in a secure directory<br />

POS01-C. Check for the existence of links<br />

when dealing with files<br />

POS35-C. Avoid race conditions while checking<br />

for the existence of a symbolic link<br />

<strong>CERT</strong> Oracle Secure <strong>Coding</strong> <strong>Standard</strong> for Java FIO00-J. Do not operate on files in shared directories<br />

MITRE CWE<br />

CWE-67, Improper Handling of Windows Device<br />

Names<br />

10.2.7 Bibliography<br />

[Garfinkel 1996]<br />

[Howard 2002]<br />

[IEEE Std 1003.1:2013]<br />

[MSDN]<br />

Section 5.6, “Device Files”<br />

Chapter 11, “Canonical Representation Issues”<br />

XSH, System Interfaces, open<br />

<strong>SEI</strong> <strong>CERT</strong> C <strong>Coding</strong> <strong>Standard</strong>: Rules for Developing Safe, Reliable, and Secure Systems 290<br />

Software Engineering Institute | Carnegie Mellon University<br />

[DISTRIBUTION STATEMENT A] Approved for public release and unlimited distribution.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!