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

Added template for CVE-2021-41182 #10467

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aredspy
Copy link

@aredspy aredspy commented Aug 5, 2024

Template / PR Information

Created template for CVE-2021-41182 (JQueryUI XSS)
References:

Template Validation

I've validated this template locally?

  • YES
  • NO

Additional Details

Template lists datepicker elements that run an alert script via the "altField" option in JQueryUI < 1.13.0
As such, datepicker elements that do not use the "altField" option are safe.
Using JQuery UI >= 1.13.0 changes how datepicker treats the "altField" option which prevents code execution.

Sample output on a test page:
image

Additional References:

@GeorginaReeder
Copy link

Thanks for your contribution @aredspy , we appreciate it! :)

@dwisiswant0
Copy link
Member

dwisiswant0 commented Oct 8, 2024

Hey @aredspy - how did you set up everything? I can't validate it on my end.

<!DOCTYPE html><html lang="en"><head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>jQuery UI Datepicker</title>
  <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css">
  <script src="https://code.jquery.com/jquery-3.7.1.js"></script>
  <script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"></script>
  <script>
  $(function() {
    $( "#datepicker" ).datepicker({
      altField: "#actualDate"
    });
  });
  </script>
</head>
<body>
<p>Date: <input type="text" id="datepicker"></p>
<input type="text" id="actualDate">
</body></html>
> window.$.datepicker._getInst(document.getElementsByClassName('hasDatepicker')[0]).settings.altField
#actualDate

@dwisiswant0 dwisiswant0 added the question Further information is requested label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants