Authorities are investigating why a witness who was due to give evidence in a trial was held in the same jail cell as the person he was testifying against.

The man was allegedly attacked by the other inmate in his cell while waiting to give evidence.

NSW Corrective Services commissioner Peter Severin said they were reviewing CCTV footage and other security systems.

"I understand that there were at least two occurrences where they were held together for periods of time," Mr Severin said.

"One was at Silverwater Metropolitan remand and reception centre in their holding yard, but there would have been others around rather than just those two, and then again at the Wollongong court cells.

"We are deeply regretful these inmates were placed together and will perform a thorough review of the allegations."

Corrections Minister David Elliot said he was considering disciplinary action.

"I've demanded an immediate explanation from Corrective Services about how this has happened, and reassurance that it will not be repeated," Mr Elliot said.

"If departmental disciplinary action must be taken, then it will be."

The witness was unable to testify because of minor injuries and was treated at Wollongong Court Cells on Tuesday.

Both inmates were subject to non-association orders.