Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#ffcccc
if(!fgets(filename, sizeof(filename), stdio)) {
    /* handle error */
}
if(!open(filename, O_WRONLY, 0600)) {
    /* handle error */
}
/* if filename is a fifo or a locked device the program may now hang in the open call */

Compliant

...

Solution (POSIX)

Wiki Markup
Device files in UNIX can be a major security hazard when an attacker is able to access them in an unauthorized way. For instance, if attackers can read or write to the {{/dev/kmem}} device, they may be able to alter their priority, UID, or other attributes of their process or simply crash the system. Similarly, access to disk devices, tape devices, network devices, and terminals being used by others all can lead to problems \[[Garfinkel 96|AA. C References#Garfinkel 96]\].

...