The vulnerability lies in the fact that Opencast was sending hashed system credentials to arbitrary URLs specified in mediapackage files during the ingest process. The analysis of the patch 2d3219113e2b9fadfb06443f5468b1c2157827a6 reveals two key functions involved in this process.
First, org.opencastproject.ingest.impl.IngestServiceImpl.addContentToRepo is the function that initiates the download of external content. It takes a URI from the mediapackage and uses a TrustedHttpClient to fetch it. The previous attempt to fix a similar vulnerability involved a check within this function to see if the URL belongs to the cluster, but this was insufficient.
The root of the vulnerability is in org.opencastproject.kernel.security.TrustedHttpClientImpl.execute. Before the patch, this method unconditionally attached digest authentication credentials to all outgoing HTTP requests. This meant any service using this client would leak credentials if it made a request to an external, attacker-controlled server.
The patch addresses this by introducing a HostCache in TrustedHttpClientImpl. This cache maintains a list of known, trusted hosts belonging to the Opencast cluster. The execute method is modified to only add authentication credentials if the request's destination host is present in this cache. This ensures that credentials are no longer sent to arbitrary external servers, effectively fixing the vulnerability. Therefore, any runtime profile during exploitation would show IngestServiceImpl.addContentToRepo calling TrustedHttpClientImpl.execute.