The first four STS missions were flown by Columbia with two pilots and had ejection seats as an option. These seats were eventually disabled (by STS 5) and removed (by STS-61-C). They could only be used to about Mach 4, in the first 1/5th of the Shuttle's powered ascent.
From researching I found that this was accomplished through ejection panels on the top of the Shuttle's cabin, using the same powered seats at the SR-71.
The Buran seems to have also had ejection seats installed, but never flew with them. Their seats seem to be designed to take the pilots 500 meters from the rocket itself.
However, with the gimbled direction of the SSME's firing, and the two extremely powerful solid rockets on the Shuttle stack, would being outside the craft have been even survivable at that close a proximity? Has any analysis on a best case/worst case scenario for these ejection seats ever been done?