Skip to content

Kaltura PHP5 API Client uses curl_exec without proper validation. #579

Description

@SachinT123

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


// 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);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions