Skip to content

Commit

Permalink
EZP-22539: XSS in admin interface
Browse files Browse the repository at this point in the history
  • Loading branch information
dpobel committed Jun 30, 2014
1 parent 3e3e098 commit 093f66f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion design/standard/templates/ezoe/upload_files.tpl
Expand Up @@ -84,7 +84,7 @@ tinyMCEPopup.onInit.add( function(){
</tr>
{foreach $grouped_related_contentobjects.files as $file sequence array( bglight, bgdark ) as $sequence}
<tr class="{$sequence}">
<td class="name">{$file.object.class_name|class_icon( small, $file.object.class_name )}&nbsp;<a href="JavaScript:eZOEPopupUtils.selectByEmbedId( {$file.object.id} )">{$file.object.name|wash|shorten( 35 )}</a></td>
<td class="name">{$file.object.class_name|class_icon( small, $file.object.class_name )}&nbsp;<a href="JavaScript:eZOEPopupUtils.selectByEmbedId( {$file.object.id|wash('javascript')} )">{$file.object.name|wash|shorten( 35 )}</a></td>
<td class="filetype">{$file.object.data_map.file.content.mime_type|wash}</td>
<td class="filesize">{$file.object.data_map.file.content.filesize|si( byte )}</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion design/standard/templates/ezoe/upload_images.tpl
Expand Up @@ -96,7 +96,7 @@ eZOEPopupUtils.settings.browseClassGenerator = function( n, hasImage ){
{foreach $grouped_related_contentobjects.images as $img}
<div class="image-thumbnail-item">
<a title="{$img.object.name|wash}" href="JavaScript:eZOEPopupUtils.selectByEmbedId( {$img.object.id} )" class="contenttype_image">
<a title="{$img.object.name|wash}" href="JavaScript:eZOEPopupUtils.selectByEmbedId( {$img.object.id|wash('javascript')} )" class="contenttype_image">
{attribute_view_gui attribute=$img.object.data_map[ $img.image_attribute ] image_class=small}
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion modules/ezoe/relations.php
Expand Up @@ -97,7 +97,7 @@

if ( !$embedObject instanceof eZContentObject || !$embedObject->canRead() )
{
echo ezpI18n::tr( 'design/standard/ezoe', 'Invalid parameter: %parameter = %value', null, array( '%parameter' => 'EmbedID', '%value' => $Params['EmbedID'] ) );
echo ezpI18n::tr( 'design/standard/ezoe', 'Invalid parameter: %parameter = %value', null, array( '%parameter' => 'EmbedID', '%value' => (int)$Params['EmbedID'] ) );
eZExecution::cleanExit();
}

Expand Down
4 changes: 2 additions & 2 deletions modules/ezoe/upload.php
Expand Up @@ -117,7 +117,7 @@
if ( $uploadedOk )
{
$newObject = $result['contentobject'];
$newObjectID = $newObject->attribute( 'id' );
$newObjectID = (int)$newObject->attribute( 'id' );
$newObjectName = $newObject->attribute( 'name' );
$newObjectNodeID = (int) $newObject->attribute( 'main_node_id' ); // this will be empty if object is stopped by approve workflow

Expand Down Expand Up @@ -173,7 +173,7 @@

$object->addContentObjectRelation( $newObjectID, $objectVersion, 0, eZContentObject::RELATION_EMBED );
echo '<html><head><title>HiddenUploadFrame</title><script type="text/javascript">';
echo 'window.parent.eZOEPopupUtils.selectByEmbedId( ' . $newObjectID . ', ' . $newObjectNodeID . ', "' . $newObjectName . '" );';
echo 'window.parent.eZOEPopupUtils.selectByEmbedId( ' . $newObjectID . ', ' . $newObjectNodeID . ', "' . json_encode( $newObjectName ) . '" );';
echo '</script></head><body></body></html>';
}
else
Expand Down

0 comments on commit 093f66f

Please sign in to comment.