I had this happen to me twice.
First time, The shop that flushed my coolant and rear differential fluids installed the wrong light bulbs in the taillight sockets and they were shorting out. I appreciated them going the extra mile and doing that for me, but.....
The second time, The stop light switch behind the brake pedal shorted out.