This is what is shown at http://iatatravelcentre.com but you can check the requirements with your details.
TWOV (Transit Without Visa):
Passengers transiting through Cape Town (CPT), Durban (DUR),
Johannesburg (JNB) or Lanseria (HLA) with a confirmed onward ticket
for a flight to a third country. They must stay in the international
transit area ...