Security scans indicate that the code snippet is vulnerable for XSS attack without sanitization of data for the cURL request.
// Set custom headers
curl_setopt($ch, CURLOPT_HTTPHEADER, $requestHeaders);
// Save response headers
curl_setopt($ch, CURLOPT_HEADERFUNCTION, array($this, 'readHeader') );
$destinationResource = null;
if($this->destinationPath)
{
$destinationResource = fopen($this->destinationPath, "wb");
curl_setopt($ch, CURLOPT_FILE, $destinationResource);
}
else
{
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
}
$result = curl_exec($ch);
if($destinationResource)
fclose($destinationResource);
$curlError = curl_error($ch);
curl_close($ch);
return array($result, $curlError);
Security scans indicate that the code snippet is vulnerable for XSS attack without sanitization of data for the cURL request.
KalturaClient/KalturaClientBase.php-- line 588, 643