Skip to content

Commit

Permalink
* Fixed: two stored XSS issues
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhuesken committed Feb 26, 2016
1 parent d471a20 commit 80c9643
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion backwpup.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: WordPress Backup Plugin
* Author: Inpsyde GmbH
* Author URI: http://inpsyde.com
* Version: 3.2.4
* Version: 3.2.5
* Text Domain: backwpup
* Domain Path: /languages/
* Network: true
Expand Down
12 changes: 8 additions & 4 deletions inc/class-destination-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,10 @@ public function job_run_archive( BackWPup_Job $job_object ) {
// Create the Transport
if ( $emailmethod == 'smtp' ) {
$transport = Swift_SmtpTransport::newInstance( $emailhost, $emailhostport );
$transport->setUsername( $emailuser );
$transport->setPassword( $emailpass );
if ( $emailuser ) {
$transport->setUsername( $emailuser );
$transport->setPassword( $emailpass );
}
if ( $emailsecure == 'ssl' )
$transport->setEncryption( 'ssl' );
if ( $emailsecure == 'tls' )
Expand Down Expand Up @@ -395,8 +397,10 @@ public function edit_ajax() {
// Create the Transport
if ( $emailmethod == 'smtp' ) {
$transport = Swift_SmtpTransport::newInstance( $emailhost, $emailhostport );
$transport->setUsername( $emailuser );
$transport->setPassword( $emailpass );
if ( $emailuser ) {
$transport->setUsername( $emailuser );
$transport->setPassword( $emailpass );
}
if ( $emailsecure == 'ssl' )
$transport->setEncryption( 'ssl' );
if ( $emailsecure == 'tls' )
Expand Down
6 changes: 3 additions & 3 deletions inc/class-page-editjob.php
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ public static function page() {
<th scope="row"><label for="name"><?php _e( 'Please name this job.', 'backwpup' ) ?></label></th>
<td>
<input name="name" type="text" id="name" data-empty="<?php _e( 'New Job', 'backwpup' ); ?>"
value="<?php echo BackWPup_Option::get( $jobid, 'name' ); ?>" class="regular-text" />
value="<?php echo esc_html( BackWPup_Option::get( $jobid, 'name' ) ); ?>" class="regular-text" />
</td>
</tr>
</table>
Expand Down Expand Up @@ -585,15 +585,15 @@ class="regular-text code help-tip" title="<?php
<th scope="row"><label for="mailaddresslog"><?php _e( 'Send log to email address', 'backwpup' ) ?></label></th>
<td>
<input name="mailaddresslog" type="text" id="mailaddresslog"
value="<?php echo BackWPup_Option::get( $jobid, 'mailaddresslog' );?>"
value="<?php echo esc_html( BackWPup_Option::get( $jobid, 'mailaddresslog' ) );?>"
class="regular-text help-tip" title="<?php esc_attr_e( 'Leave empty to not have log sent. Or separate with , for more than one receiver.', 'backwpup' ); ?>" />
</td>
</tr>
<tr>
<th scope="row"><label for="mailaddresssenderlog"><?php _e( 'Email FROM field', 'backwpup' ) ?></label></th>
<td>
<input name="mailaddresssenderlog" type="text" id="mailaddresssenderlog"
value="<?php echo BackWPup_Option::get( $jobid, 'mailaddresssenderlog' );?>"
value="<?php echo esc_html( BackWPup_Option::get( $jobid, 'mailaddresssenderlog' ) );?>"
class="regular-text help-tip" title="<?php esc_attr_e( 'Email "From" field (Name &lt;&#160;[email protected]&#160;&gt;)', 'backwpup' ); ?>" />
</td>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions inc/class-page-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static function save_post_form() {
update_site_option( 'backwpup_cfg_protectfolders', isset( $_POST[ 'protectfolders' ] ) ? 1 : 0 );
$_POST[ 'jobrunauthkey' ] = preg_replace( '/[^a-zA-Z0-9]/', '', trim( $_POST[ 'jobrunauthkey' ] ) );
update_site_option( 'backwpup_cfg_jobrunauthkey', $_POST[ 'jobrunauthkey' ] );
$_POST[ 'logfolder' ] = trailingslashit( str_replace( '\\', '/', trim( stripslashes( $_POST[ 'logfolder' ] ) ) ) );
$_POST[ 'logfolder' ] = trailingslashit( str_replace( '\\', '/', trim( stripslashes( esc_attr( $_POST[ 'logfolder' ] ) ) ) ) );
//set def. folders
if ( empty( $_POST[ 'logfolder' ] ) || $_POST[ 'logfolder' ] === '/' ) {
delete_site_option( 'backwpup_cfg_logfolder' );
Expand Down Expand Up @@ -196,7 +196,7 @@ public static function page() {
<th scope="row"><label for="logfolder"><?php _e( 'Log file folder', 'backwpup' ); ?></label></th>
<td>
<input name="logfolder" type="text" id="logfolder" title="<?php esc_attr_e( 'You can use absolute or relative path! Relative path is relative to WP_CONTENT_DIR.', 'backwpup' ); ?>"
value="<?php echo get_site_option( 'backwpup_cfg_logfolder' );?>"
value="<?php echo esc_attr( get_site_option( 'backwpup_cfg_logfolder' ) );?>"
class="regular-text code help-tip"/>
</td>
</tr>
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: inpsyde, danielhuesken, Bueltge, nullbyte
Tags: Amazon, Amazon S3, back up, backup, chinese, cloud, cloud files, database, db backup, dropbox, dump, file, french, ftp, ftps, german, migrate, multisite, russian, schedule, sftp, storage, S3, time, upload, xml
Requires at least: 3.8
Tested up to: 4.4.1
Stable tag: 3.2.4
Stable tag: 3.2.5
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -170,6 +170,9 @@ Please check all settings after the update:


== Changelog ==
= Version 3.2.5 =
* Fixed: two stored XSS issues

= Version 3.2.4 =
* Added: Backup database triggers
* Fixed: Charset issues on file names in archives
Expand Down

0 comments on commit 80c9643

Please sign in to comment.