Skip to content

Commit 80c9643

Browse files
committed
* Fixed: two stored XSS issues
1 parent d471a20 commit 80c9643

File tree

5 files changed

+18
-11
lines changed

5 files changed

+18
-11
lines changed

backwpup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Description: WordPress Backup Plugin
66
* Author: Inpsyde GmbH
77
* Author URI: http://inpsyde.com
8-
* Version: 3.2.4
8+
* Version: 3.2.5
99
* Text Domain: backwpup
1010
* Domain Path: /languages/
1111
* Network: true

inc/class-destination-email.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,10 @@ public function job_run_archive( BackWPup_Job $job_object ) {
271271
// Create the Transport
272272
if ( $emailmethod == 'smtp' ) {
273273
$transport = Swift_SmtpTransport::newInstance( $emailhost, $emailhostport );
274-
$transport->setUsername( $emailuser );
275-
$transport->setPassword( $emailpass );
274+
if ( $emailuser ) {
275+
$transport->setUsername( $emailuser );
276+
$transport->setPassword( $emailpass );
277+
}
276278
if ( $emailsecure == 'ssl' )
277279
$transport->setEncryption( 'ssl' );
278280
if ( $emailsecure == 'tls' )
@@ -395,8 +397,10 @@ public function edit_ajax() {
395397
// Create the Transport
396398
if ( $emailmethod == 'smtp' ) {
397399
$transport = Swift_SmtpTransport::newInstance( $emailhost, $emailhostport );
398-
$transport->setUsername( $emailuser );
399-
$transport->setPassword( $emailpass );
400+
if ( $emailuser ) {
401+
$transport->setUsername( $emailuser );
402+
$transport->setPassword( $emailpass );
403+
}
400404
if ( $emailsecure == 'ssl' )
401405
$transport->setEncryption( 'ssl' );
402406
if ( $emailsecure == 'tls' )

inc/class-page-editjob.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ public static function page() {
443443
<th scope="row"><label for="name"><?php _e( 'Please name this job.', 'backwpup' ) ?></label></th>
444444
<td>
445445
<input name="name" type="text" id="name" data-empty="<?php _e( 'New Job', 'backwpup' ); ?>"
446-
value="<?php echo BackWPup_Option::get( $jobid, 'name' ); ?>" class="regular-text" />
446+
value="<?php echo esc_html( BackWPup_Option::get( $jobid, 'name' ) ); ?>" class="regular-text" />
447447
</td>
448448
</tr>
449449
</table>
@@ -585,15 +585,15 @@ class="regular-text code help-tip" title="<?php
585585
<th scope="row"><label for="mailaddresslog"><?php _e( 'Send log to email address', 'backwpup' ) ?></label></th>
586586
<td>
587587
<input name="mailaddresslog" type="text" id="mailaddresslog"
588-
value="<?php echo BackWPup_Option::get( $jobid, 'mailaddresslog' );?>"
588+
value="<?php echo esc_html( BackWPup_Option::get( $jobid, 'mailaddresslog' ) );?>"
589589
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' ); ?>" />
590590
</td>
591591
</tr>
592592
<tr>
593593
<th scope="row"><label for="mailaddresssenderlog"><?php _e( 'Email FROM field', 'backwpup' ) ?></label></th>
594594
<td>
595595
<input name="mailaddresssenderlog" type="text" id="mailaddresssenderlog"
596-
value="<?php echo BackWPup_Option::get( $jobid, 'mailaddresssenderlog' );?>"
596+
value="<?php echo esc_html( BackWPup_Option::get( $jobid, 'mailaddresssenderlog' ) );?>"
597597
class="regular-text help-tip" title="<?php esc_attr_e( 'Email "From" field (Name &lt;&#160;[email protected]&#160;&gt;)', 'backwpup' ); ?>" />
598598
</td>
599599
</tr>

inc/class-page-settings.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public static function save_post_form() {
8484
update_site_option( 'backwpup_cfg_protectfolders', isset( $_POST[ 'protectfolders' ] ) ? 1 : 0 );
8585
$_POST[ 'jobrunauthkey' ] = preg_replace( '/[^a-zA-Z0-9]/', '', trim( $_POST[ 'jobrunauthkey' ] ) );
8686
update_site_option( 'backwpup_cfg_jobrunauthkey', $_POST[ 'jobrunauthkey' ] );
87-
$_POST[ 'logfolder' ] = trailingslashit( str_replace( '\\', '/', trim( stripslashes( $_POST[ 'logfolder' ] ) ) ) );
87+
$_POST[ 'logfolder' ] = trailingslashit( str_replace( '\\', '/', trim( stripslashes( esc_attr( $_POST[ 'logfolder' ] ) ) ) ) );
8888
//set def. folders
8989
if ( empty( $_POST[ 'logfolder' ] ) || $_POST[ 'logfolder' ] === '/' ) {
9090
delete_site_option( 'backwpup_cfg_logfolder' );
@@ -196,7 +196,7 @@ public static function page() {
196196
<th scope="row"><label for="logfolder"><?php _e( 'Log file folder', 'backwpup' ); ?></label></th>
197197
<td>
198198
<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' ); ?>"
199-
value="<?php echo get_site_option( 'backwpup_cfg_logfolder' );?>"
199+
value="<?php echo esc_attr( get_site_option( 'backwpup_cfg_logfolder' ) );?>"
200200
class="regular-text code help-tip"/>
201201
</td>
202202
</tr>

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: inpsyde, danielhuesken, Bueltge, nullbyte
33
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
44
Requires at least: 3.8
55
Tested up to: 4.4.1
6-
Stable tag: 3.2.4
6+
Stable tag: 3.2.5
77
License: GPLv3
88
License URI: http://www.gnu.org/licenses/gpl-3.0.html
99

@@ -170,6 +170,9 @@ Please check all settings after the update:
170170

171171

172172
== Changelog ==
173+
= Version 3.2.5 =
174+
* Fixed: two stored XSS issues
175+
173176
= Version 3.2.4 =
174177
* Added: Backup database triggers
175178
* Fixed: Charset issues on file names in archives

0 commit comments

Comments
 (0)