Skip to content

Conversation

@kueken
Copy link
Collaborator

@kueken kueken commented Jul 21, 2025

Potential fix for https://github.com/E2OpenPlugins/e2openplugin-OpenWebif/security/code-scanning/59

To fix the problem, we should ensure that the altField option can never be interpreted as a HTML string by jQuery. The safest way is to ensure that only a valid selector string is processed, and to avoid passing user-controlled strings that could be parsed as HTML. Specifically, before using $( altField ), we should verify that altField is a string that does NOT start with <, and if it does, we should not use it, or alternatively, escape it or ignore it. Additionally, we should document in comments that altField should not accept arbitrary user input and must be a selector, not HTML.

The best minimal fix within the file is:

  • In the _updateAlternate method (lines around 8846-8856), before using $( altField ), check that altField is a string and does not start with <.
  • If it does start with <, skip updating the alternate field or throw an error.
  • Add a comment documenting the reason for this check.

This fix should be implemented in the region of _updateAlternate in sourcefiles/modern/plugins/jquery/jquery-ui-1.12.1.js.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@kueken kueken marked this pull request as ready for review July 21, 2025 16:11
@kueken kueken merged commit 20391a4 into master Jul 21, 2025
6 checks passed
@kueken kueken deleted the alert-autofix-59 branch July 21, 2025 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants