Skip to content
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

50189 reflected XSS #846

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading