Dylann Roof, 22, was targeted by Dwayne Stafford, who is black, after he went into the shower block at about 7.45am on Thursday at Charleston County detention centre.
Dwayne Stafford caused bruising to Dylann Roof's face and back. He was medically examined before being returned to his cell.
Charleston County Sheriff Al Cannon has said Mr Roof does not want to press charges.
Officials are investigating how Mr Stafford managed to get through a cell door to reach Mr Roof.
Mr Roof faces the death penalty in upcoming trials in both federal and state courts after the deaths of nine Black Christians at Emanuel AME Church in Charleston.
His federal trial is set for November while his state trial is set for next year.
Prosecutors allege Dylann Roof wanted to start a race war.
Defence lawyers have said in both state and federal courts that Roof is willing to plead guilty and serve a life term in prison if prosecutors do not seek the death penalty.
They have also asked a judge to declare the federal death penalty unconstitutional.