Lecture07 - CSE 484(Winter 2008 Software Security Attacks...

This preview shows page 1 - 3 out of 5 pages.

Software Security: Attacks, Defenses, and Design Principles Tadayoshi Kohno Thanks to Dan Boneh, Dieter Gollmann, John Manferdelli, John Mitchell, Vitaly Shmatikov, Bennet Yee, and many others for sample slides and materials ... CSE 484 (Winter 2008) Goals for Today TOCTOU Integer Overflow, Casting Randomness Timing Attacks Defensive Mechanisms Software Development Design Principles TOCTOU TOCTOU == Time of Check to Time of Use Goal: Open only regular files (not symlink, etc) Attacker can change meaning of path between stat and open (and access files he or she shouldn’t) int openfile(char *path) { struct stat s; if (stat(path, &s) < 0) return -1; if (!S_ISRREG(s.st_mode)) { error("only allowed to regular files!"); return -1; } return open(path, O_RDONLY); } Integer Overflow and Implicit Cast If len is negative, may copy huge amounts of input into buf char buf[80]; void vulnerable() { int len = read_int_from_network(); char *p = read_string_from_network(); if (len > sizeof buf) { error("length too large, nice try!"); return; } memcpy(buf, p, len); } void *memcpy(void *dst, const void * src, size_t n); typedef unsigned int size_t; (from www-inst.eecs.berkeley.edu—implflaws.pdf )
Image of page 1

Subscribe to view the full document.

Integer Overflow and Implicit Cast
Image of page 2
Image of page 3
  • Winter '08
  • Johnsmith
  • Computer Security, Randomness, len, int len, typedef unsigned int, return pseudo-random integer

{[ snackBarMessage ]}

Get FREE access by uploading your study materials

Upload your study materials now and get free access to over 25 million documents.

Upload now for FREE access Or pay now for instant access
Christopher Reinemann
"Before using Course Hero my grade was at 78%. By the end of the semester my grade was at 90%. I could not have done it without all the class material I found."
— Christopher R., University of Rhode Island '15, Course Hero Intern

Ask a question for free

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern