Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLAT-9748: prevent svg thumb asset script xss attack #8291

Merged
merged 3 commits into from
Apr 8, 2019

Conversation

inbal-ben-david
Copy link
Collaborator

No description provided.

@@ -1055,5 +1067,24 @@ public function exportAction ( $assetId , $storageProfileId )
{
return parent::exportAction($assetId, $storageProfileId);
}

public function getThumbPath($thumbAsset)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to assetUstils::getLocalFIlePath

return true;
}

public static function getMimeType($filePath)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to kFileUtils

@@ -128,6 +128,12 @@ function setContentAction($id, KalturaContentResource $contentResource)
$contentResource->validateAsset($dbThumbAsset);
$kContentResource = $contentResource->toObject();
$this->attachContentResource($dbThumbAsset, $kContentResource);
$filePath = $this->getThumbPath($dbThumbAsset);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move validation to pre-save

@@ -2301,4 +2301,42 @@ public static function verifyThumbSrcExist($entry, $destThumbParams)
}
}

public static function validateThumbContent($thumbPath)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to myThumbUtils

@MosheMaorKaltura
Copy link
Contributor

reviewed

@inbal-ben-david inbal-ben-david merged commit fdf5848 into Naos-14.18.0 Apr 8, 2019
@inbal-ben-david inbal-ben-david deleted the Naos-14.18.0-PLAT-9748 branch April 8, 2019 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants