Skip to content

Commit

Permalink
50189 reflected XSS (#846)
Browse files Browse the repository at this point in the history
  • Loading branch information
yeneastgate authored Jul 9, 2024
1 parent b9191e7 commit f53aad0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion plugin/Gui/AdminPageFormSettingsBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
use function __;
use function esc_sql;
use function wp_enqueue_script;
use function esc_attr;

/**
*
Expand Down Expand Up @@ -761,7 +762,7 @@ public function renderContent()
$this->generatePageMainTitle( $this->getPageTitle() );
echo '<form id="onoffice-ajax" action="' . admin_url( 'admin-post.php' ) . '" method="post">';
echo '<input type="hidden" name="action" value="' . get_current_screen()->id . '" />';
echo '<input type="hidden" name="record_id" value="' . ( $_GET['id'] ?? 0 ) . '" />';
echo '<input type="hidden" name="record_id" value="' . esc_attr( $_GET['id'] ?? 0 ) . '" />';
echo '<input type="hidden" name="type" value="' . $this->getType() . '" />';
wp_nonce_field( get_current_screen()->id, 'nonce' );
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
Expand Down
3 changes: 2 additions & 1 deletion plugin/Gui/AdminPageSettingsBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
use function wp_nonce_field;
use function wp_register_script;
use function wp_verify_nonce;
use function esc_attr;

/**
*
Expand Down Expand Up @@ -173,7 +174,7 @@ public function renderContent()
$this->generatePageMainTitle( $this->getPageTitle() );
echo '<form id="onoffice-ajax" action="' . admin_url( 'admin-post.php' ) . '" method="post">';
echo '<input type="hidden" name="action" value="' . get_current_screen()->id . '" />';
echo '<input type="hidden" name="record_id" value="' . ( $_GET['id'] ?? 0 ) . '" />';
echo '<input type="hidden" name="record_id" value="' . esc_attr( $_GET['id'] ?? 0 ) . '" />';
wp_nonce_field( get_current_screen()->id, 'nonce' );
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
Expand Down

0 comments on commit f53aad0

Please sign in to comment.