Skip to content

[Security] GDPR security issue fixes - #3063

Merged
shewa12 merged 5 commits into
4.2.0from
security/gdpr
Oct 13, 2026
Merged

shewa12 merged 5 commits into
4.2.0from
security/gdpr

Conversation

@Anindra123

@Anindra123 Anindra123 commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator
  • Critical : XSS Vulnerability on consent modal

    • Any user can register with the name <img src=x onerror='....'> this user name is placed directly on the legal consent field thus executing javascript on view
    • To fix this i have first encoded the string using tutor_json_encode then decoded on the javascript file, this ensure the content is rendered as string instead of html element
  • CSV Formula Injection Vulnerability

    • Any user when logging in and saving a consent can intercept the request and update the User Agent to something like =HYPERLINK('...') which is saved in the database and rendered on the consent modal, so when admin downloads the csv from the modal it executes the formula and converts the cell.
    • To fix this i have added a new method sanitize_csv_field which makes sure the formula doesn't get executed, this sanitization is done when viewing the consent and during saving
  • Misc fixes

    • Removed is_consent_given_by_user which is not being used
    • Updated is_exists to user_exist as is_exists validation method does not exist in ValidationHelper
    • Update response_bad_request to json_response

@Anindra123 Anindra123 self-assigned this Oct 6, 2026
@Anindra123 Anindra123 added the 4.1.1 . label Oct 6, 2026
@Anindra123
Anindra123 marked this pull request as ready for review October 6, 2026 09:17

@shewa12 shewa12 left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a couple of inline comments on the consent modal XSS handling and CSV sanitization.

Comment thread assets/src/js/admin-dashboard/segments/consent-logs.js Outdated
Comment thread GDPR/Controllers/UserConsent.php Outdated
@Anindra123 Anindra123 added 4.2.0 and removed 4.1.1 . labels Oct 8, 2026
@Anindra123
Anindra123 changed the base branch from 4.1.1 to 4.2.0 October 8, 2026 05:39
$user_login = $user->user_login ?? '';
$avatar_src = get_avatar_url( $user_id, array( 'size' => 40 ) );

$value = '<button type="button" class="tutor-btn tutor-btn-outline-primary tutor-btn-sm" data-tutor-modal-target="tutor-consent-logs-modal" data-consent-logs-trigger data-user-id="'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of creating multiple attributes, create a single attribute and pass the JSON String, then read from the JSON data.

@shewa12
shewa12 merged commit 61bb969 into 4.2.0 Oct 13, 2026
11 of 13 checks passed
@Anindra123
Anindra123 deleted the security/gdpr branch October 14, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants