-
Notifications
You must be signed in to change notification settings - Fork 174
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
Conversation
@@ -1055,5 +1067,24 @@ public function exportAction ( $assetId , $storageProfileId ) | |||
{ | |||
return parent::exportAction($assetId, $storageProfileId); | |||
} | |||
|
|||
public function getThumbPath($thumbAsset) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to myThumbUtils
reviewed |
No description provided.