Buffer Overflow Protection - Canaries - Random XOR Canaries

Random XOR Canaries

Random XOR Canaries are Random Canaries that are XOR scrambled using all or part of the control data. In this way, once the canary or the control data is clobbered, the canary value is wrong.

Random XOR Canaries have the same vulnerabilities as Random Canaries, except that the 'read from stack' method of getting the canary is a bit more complicated. The attacker must get the canary, the algorithm, and the control data to generate the original canary for re-encoding into the canary he needs to use to spoof the protection.

In addition, Random XOR Canaries can protect against a certain type of attack involving overflowing a buffer in a structure into a pointer to change the pointer to point at a piece of control data. Because of the XOR encoding, the canary will be wrong if the control data or return value is changed. Because of the pointer, the control data or return value can be changed without overflowing over the canary.

Although these canaries protect the control data from being altered by clobbered pointers, they do not protect any other data or the pointers themselves. Function pointers especially are a problem here, as they can be overflowed into and will execute shellcode when called.

Read more about this topic:  Buffer Overflow Protection, Canaries

Famous quotes containing the word random:

    poor Felix Randal;
    How far from then forethought of, all thy more boisterous years,
    When thou at the random grim forge, powerful amidst peers,
    Didst fettle for the great gray drayhorse his bright and battering
    sandal!
    Gerard Manley Hopkins (1844–1889)