-
Notifications
You must be signed in to change notification settings - Fork 11
Patched XSS vulnerablity #263
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -77,7 +77,7 @@ | |||||||
| <th scope="row" class="check-column"> | ||||||||
| <input type="checkbox" name="post[]" v-model="checkedItems" :value="entry.id"> | ||||||||
| </th> | ||||||||
| <td v-for="(header, index) in columns"><span v-html="entry.fields[index]"></span></td> | ||||||||
| <td v-for="(header, index) in columns"><span>{{ entry.fields[index] }}</span></td> | ||||||||
| <th class="col-entry-details"> | ||||||||
| <template v-if="status == 'trash'"> | ||||||||
| <a href="#" @click.prevent="restore(entry.id)"><?php esc_html_e( 'Restore', 'weforms' ); ?></a> | ||||||||
|
|
@@ -96,7 +96,7 @@ | |||||||
| <th scope="row" class="check-column"> | ||||||||
| <input type="checkbox" name="post[]" v-model="checkedItems" :value="entry.id"> | ||||||||
| </th> | ||||||||
| <td v-for="(header, index) in columns"><span v-html="entry.fields[index]"></span></td> | ||||||||
| <td v-for="(header, index) in columns"><span>{{ entry.fields[index] }}</span></td> | ||||||||
jacobd91 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
| <th class="col-entry-details"> | ||||||||
| <template v-if="status == 'trash'"> | ||||||||
| <a href="#" @click.prevent="restore(entry.id)"><?php esc_html_e( 'Restore', 'weforms' ); ?></a> | ||||||||
|
|
@@ -425,7 +425,9 @@ | |||||||
| </div> | ||||||||
| <div v-else-if="field.type === 'country_list_field'">{{ getCountryName( field.value ) }}</div> | ||||||||
| <div v-else-if="field.type === 'address_field'" v-html="getAddressFieldValue( field.value)"></div> | ||||||||
| <div v-else v-html="field.value"></div> | ||||||||
| <div v-else-if="field.type === 'textarea_field'" v-html="field.value"></div> | ||||||||
jacobd91 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
| <div v-else-if="field.type === 'image_upload' || field.type === 'file_upload' || field.type === 'signature_field' || field.type === 'checkbox_grid' || field.type === 'multiple_choice_grid'" v-html="field.value"></div> | ||||||||
|
||||||||
| <div v-else-if="field.type === 'image_upload' || field.type === 'file_upload' || field.type === 'signature_field' || field.type === 'checkbox_grid' || field.type === 'multiple_choice_grid'" v-html="field.value"></div> | |
| <div v-else-if="field.type === 'image_upload' || field.type === 'file_upload' || field.type === 'signature_field' || field.type === 'checkbox_grid' || field.type === 'multiple_choice_grid'" v-html="field.value"></div> | |
| <div v-else-if="field.type === 'multiple_product'" v-html="field.value"></div> |
jacobd91 marked this conversation as resolved.
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -142,7 +142,7 @@ public function populate_entry_data() { | |||||
| $this->raw_fields[ $result->meta_key ]['value'] = $value; | ||||||
|
|
||||||
| if ( $field['type'] == 'textarea_field' ) { | ||||||
| $value = weforms_format_text( $value ); | ||||||
| $value = wp_kses_post( weforms_format_text( $value ) ); | ||||||
| } elseif ( $field['type'] == 'name_field' ) { | ||||||
| $value = implode( ' ', explode( WeForms::$field_separator, $value ) ); | ||||||
| } elseif ( in_array( $field['type'], [ 'dropdown_field', 'radio_field' ] ) ) { | ||||||
|
|
@@ -180,16 +180,16 @@ public function populate_entry_data() { | |||||
| if ( $field['type'] == 'image_upload' ) { | ||||||
| $thumb = wp_get_attachment_image( $attachment_id, 'thumbnail' ); | ||||||
| } else { | ||||||
| $thumb = get_post_field( 'post_title', $attachment_id ); | ||||||
| $thumb = esc_html( get_post_field( 'post_title', $attachment_id ) ); | ||||||
| } | ||||||
|
|
||||||
| $full_size = wp_get_attachment_url( $attachment_id ); | ||||||
| $full_size = esc_url( wp_get_attachment_url( $attachment_id ) ); | ||||||
|
|
||||||
| $file_field .= sprintf( '<a href="%s" target="_blank">%s</a> ', $full_size, $thumb ); | ||||||
|
||||||
| $file_field .= sprintf( '<a href="%s" target="_blank">%s</a> ', $full_size, $thumb ); | |
| $file_field .= sprintf( '<a href="%s" target="_blank" rel="noopener noreferrer">%s</a> ', $full_size, $thumb ); |
Copilot
AI
Mar 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the signature_field rendering, the condition isset( $_REQUEST['action'] ) != 'weforms_pdf_download' compares a boolean to a string, so it will always evaluate true and the else branch is effectively unreachable. This can break the intended PDF-download behavior and URL handling. Compare the actual action value (and handle missing action) instead of using isset() in the comparison.
Uh oh!
There was an error while loading. Please reload this page.