-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
The Web Application Hacker's Handbook
By :
Format string vulnerabilities arise when user-controllable input is passed as the format string parameter to a function that takes format specifiers that may be misused, as in the printf family of functions in C. These functions take a variable number of parameters, which may consist of different data types such as numbers and strings. The format string passed to the function contains specifiers, which tell it what kind of data is contained in the variable parameters, and in what format it should be rendered.
For example, the following code outputs a message containing the value of the count variable, rendered as a decimal:
printf("The value of count is %d", count.);
The most dangerous format specifier is %n. This does not cause any data to be printed. Rather, it causes the number of bytes output so far to be written to the address of the pointer passed in as the associated variable parameter. For example:
int count = 43;
int written = 0;
printf...
Change the font size
Change margin width
Change background colour