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

[Snyk] Upgrade select2 from 3.5.1 to 4.0.13 #2

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

Conversation

JhayceFrancis
Copy link
Owner

This PR was automatically created by Snyk using the credentials of a real user.


![snyk-top-banner](https://github.com/andygongea/OWASP-Benchmark/assets/818805/c518c423-16fe-447e-b67f-ad5a49b5d123)

Snyk has created this PR to upgrade select2 from 3.5.1 to 4.0.13.

ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.


⚠️ Warning: This PR contains major version upgrade(s), and may be a breaking change.

  • The recommended version is 19 versions ahead of your current version.

  • The recommended version was released on 4 years ago.

Issues fixed by the recommended upgrade:

Issue Score Exploit Maturity
medium severity Cross-site Scripting (XSS)
SNYK-JS-SELECT2-456562
519 No Known Exploit
Release notes
Package name: select2
  • 4.0.13 - 2020-01-28

    New features / improvements

    • Trigger input event before change events (#4649)
    • Feed back the keypress code that was responsible for the 'close' event (#5513)
    • Only trigger selection:update once on DOM change events (#5734)

    Bug fixes

    • Prevent opening of disabled elements (#5751)

    Documentation

    • Fix "edit this page" links in docs (#5689)

    Miscellaneous


    Select2 is a looking for sponsors to keep development active. Interested in seeing Select2 continue to be developed? Sponsor @ kevin-brown (and by extension, Select2) on GitHub Sponsors or sponsor Select2 on Open Collective!

  • 4.0.12 - 2019-11-06

    Bug fixes

    • Fixes incorrect offset when using the Shadow DOM and styling the <html> element (#5682)

    Miscellaneous

    • Replace cdnjs with jsDelivr in the documentation (#5687)
    • Fix incorrect provider for the automated NPM deployment (#5686)

    Select2 is a looking for sponsors to keep development active. Interested in seeing Select2 continue to be developed? Sponsor @ kevin-brown (and by extension, Select2) on GitHub Sponsors!

  • 4.0.11 - 2019-10-13

    Bug fixes

    • Fixes jQuery migrate error when getting offset when dropdownParent not in document (#5584)

    Miscellaneous

    • Enable GitHub actions for CI (#5591)
    • Documentation has been moved into and is deployed from the code repository (#5638)
    • Remove Travis CI integration (#5665)
  • 4.0.10 - 2019-08-28

    New features / improvements

    • Support passing in a selector for dropdownParent option (#5622)

    Bug fixes

    • Fix bug where dropdowns pointing upwards were incorrectly positioned (#5621)
  • 4.0.9 - 2019-08-22

    New features / improvements

    • Mirror disabled state through aria-disabled on selection (#5579)
    • Select2 now clears the internal ID when it is destroyed (#5587)
    • Set the main ARIA 1.1 roles and properties for comboboxes (#5582)
    • The language option now has a clearly defined fallback chain (#5602)

    Bug fixes

    • Do not propagate click when search box is not empty (#5580)
    • Fix maximumSelectionLength being ignored by closeOnSelect (#5581)
    • Fix generated options not receiving result IDs (#5586)
    • Remove selection title attribute if text is empty (#5589)
    • Reposition dropdown whenever items are selected (#5590)
    • Fix dropdown positioning when displayed above with messages (#5592)
    • Fix search box expanding width of container (#5595)
    • allowClear no longer shifts selections to a new line (#5603)

    Translations

    • Fix error in German translations (#5604)

    Miscellaneous

    • Updated development grunt version so it no longer shows as vulnerable (#5597)
    • Remove unused variables (#5554)
  • 4.0.8 - 2019-07-21

    New features / improvements

    • Test against and fix compatibility with jQuery 3.4.1 (#5531)
    • Results respect disabled state of <option> (#5560)
    • Add computedstyle option for calculating the width (#5559)

    Bug fixes

    • Fix tag creation being broken in 4.0.7 (#5558)
    • Fix infinite scroll when the scrollbar is not visible (#5575)
    • Revert change to focusing behaviour in 4.0.6 (#5576)

    Translations

    • Fix wording in French translations (#5521)

    Miscellaneous

    • Update grunt-contrib-qunit to latest version (#5530)
    • Removed unused .select2-selection__placeholder CSS definitions for multiple selects (#5508)
    • Remove deprecated jQuery shorthand (#5564)
  • 4.0.7 - 2019-05-14

    New features/improvements

    • Do not close on select if Ctrl or Meta (Cmd) keys being held (#5222)

    Bug fixes

    • Fixed issue where single select boxes would automatically reopen when they were closed (#5490, #5492)

    Miscellaneous

    • Move almond and jquery-mousewheel to devDependencies (#5489)
  • 4.0.7-rc.0 - 2019-05-01
  • 4.0.6 - 2019-04-28
  • 4.0.6-rc.1 - 2017-11-22
  • 4.0.6-rc.0 - 2017-10-26
  • 4.0.5 - 2017-10-25
  • 4.0.4 - 2017-10-01
  • 4.0.3 - 2016-05-27
  • 4.0.2 - 2016-03-09
  • 4.0.2-rc.1 - 2016-02-14
  • 4.0.1 - 2015-11-27
  • 4.0.0 - 2015-07-05
  • 3.5.2-browserify - 2015-01-16
  • 3.5.1 - 2014-08-13
from select2 GitHub release notes

Important

  • Warning: This PR contains a major version upgrade, and may be a breaking change.
  • Check the changes in this PR to ensure they won't cause issues with your project.
  • This PR was automatically created by Snyk using the credentials of a real user.
  • Max score is 1000. Note that the real score may have changed since the PR was raised.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.

For more information:

Snyk has created this PR to upgrade select2 from 3.5.1 to 4.0.13.

See this package in npm:
select2

See this project in Snyk:
https://app.snyk.io/org/jc-network-projects/project/0beca810-6aea-4905-bab5-b98a8271c6ce?utm_source=github&utm_medium=referral&page=upgrade-pr
Copy link

Cross-Site Scripting

Play SecureFlag Play Labs on this vulnerability with SecureFlag!

Description

Cross-site scripting (otherwise known as XSS) is a vulnerability that allows a malicious actor to manipulate a legitimate user's interactions with a vulnerable web application. Attackers exploit this to inject code into other legitimate users' browsers, often allowing them to perform any actions that the target user would normally perform, including gaining access to their data. In cases where the victim user has privileged application access, the attacker may use XSS to seize control of the application.

XSS attacks typically occur in web applications when data is received, frequently in the form of a web request, and the data is reflected back in the HTTP response to the user without validation.

XSS attacks can generally be divided into the following three categories.

Read more

Reflected XSS

Reflected XSS attacks arise when a web server reflects an injected script, such as a search result, an error message, or any other response that includes some or all of the input sent to the server as part of the request.

The attack is then delivered to the victim through another route (e.g., e-mail or an alternative website), thus tricking the user into clicking on a malicious link. The injected code travels to the vulnerable website, which reflects the attack payload back to the user's browser. The browser then executes the code because it came from a "trusted" server.

Stored XSS

In the Stored XSS attack, the injected script is stored on the target application as legitimate content, such as a message in a forum or a comment in a blog post. The injected code is stored in the database and sent to the users when it is retrieved, thus executing the attack payload in the victim's browser.

DOM-based XSS

DOM-based XSS vulnerabilities usually occur when the JavaScript in a page takes user-provided data from a source in the HTML, such as the document.location, and passes it to a JavaScript function that allows JavaScript code to be run, such as innerHTML(). The classic attack delivers the payload to the victim through another route (e.g., e-mail or an alternative website), thus tricking the user into visiting a malicious link. The exploitation is client-side, and the code is immediately executed in the user's browser.

Impact

XSS attacks can result in the disclosure of the user's session cookie, allowing an attacker to hijack the user's session and take over the account. Even though HTTPOnly is used to protect cookies, an attacker can still execute actions on behalf of the user in the context of the affected website.

As with all of the severe vulnerabilities that make up a part of the OWASP Top 10, XSS attacks can result in the complete compromise of a user's system, as stated in the description, if an attacker compromises a user holding the 'keys to the kingdom,' i.e., privileged access to applications/administrator rights, the results can be devastating.

Prevention

XSS attacks can be mitigated by performing appropriate server-side validation and escaping. Remediation relies on performing Output Encoding (e.g., using an escape syntax) for the type of HTML context into which untrusted data is reflected.

Input Validation

  • Exact Match: Only accept values from a finite list of known values.
  • Allow list: If a list of all the possible values can't be created, accept only known good data and reject all unexpected input.
  • Deny list: If an allow-list approach is not feasible (on free-form text areas, for example), reject all known bad values.

Output Encoding

Output Encoding is used to convert untrusted input into a safe form where the input is displayed as data to the user without executing as code in the browser. Output Encoding is performed when the data leaves the application to a downstream component. The table below lists the possible downstream contexts where the untrusted input could be used:

Context Code Encoding
HTML Body <div>USER-CONTROLLED-DATA</div> HTML Encoding
HTML Attribute <input type="text" value="USER-CONTROLLED-DATA"> HTML Attribute Encoding
URL Parameter <a href="/search?value=USER-CONTROLLED-DATA">Search</a> URL Encoding
CSS <div style="width: USER-CONTROLLED-DATA;">Selection</div> CSS Hex Encoding
JavaScript <script>var lang ='USER-CONTROLLED-DATA';</script>
<script>setLanguage('USER-CONTROLLED-DATA');</script>
JavaScript Encoding

The following chart details a list of critical output encoding methods required to mitigate Cross-Site Scripting:

Encoding Type Encoding Mechanism
HTML Entity Encoding Convert &to &amp;
Convert <to &lt;
Convert >to &gt;
Convert "to &quot;
Convert 'to &#x27;
Convert /to &#x2F;
HTML Attribute Encoding Except for alphanumeric characters, escape all characters with the HTML Entity &#xHH; format, including spaces. (HH = Hex Value)
URL Encoding For standard percent encoding see here. URL encoding should only be used to encode parameter values, not the entire URL or path fragments of a URL.
JavaScript Encoding Except for alphanumeric characters, escape all characters with the \uXXXX unicode escaping format (XX = Integer)
CSS Hex Encoding CSS escaping supports \XX and \XXXXXX. Using a two-character escape can cause problems if the next character continues the escape sequence. There are two solutions:
- Add a space after the CSS escape (the CSS parser will ignore it)
- Use the full amount of CSS escaping possible by zero-padding the value.

Defense in Depth

Content Security Policy (CSP)

The Content Security Policy (CSP) is a browser mechanism that enables the creation of source allow lists for client-side resources of web applications, e.g., JavaScript, CSS, images, etc. CSP, via a special HTTP header, instructs the browser to only execute or render resources from those sources.

For example:

Content-Security-Policy: default-src: 'self'; script-src: 'self' static.domain.tld

The above CSP will instruct the web browser to load all resources only from the page's origin and JavaScript source code files from static.domain.tld. For more details on the Content Security Policy, including what it does and how to use it, see this article.

Content Types

To prevent non-HTML HTTP responses from embedding data, that might be dangerously interpreted as HTML or JavaScript, it is recommended to always send the Content-Type header in the HTTP response to ensure that browsers interpret it in the way it's intended.

Modern Frameworks

JavaScript frameworks (e.g., Angular, React) or server-side templating systems (e.g., Go Templates) have robust built-in protections against Reflected Cross-Site Scripting.

Testing

Verify that context-aware, preferably automated - or at worst, manual - output escaping protects against reflected, stored, and DOM-based XSS.

View this in the SecureFlag Knowledge Base

Micro-Learning Topic: Cross-site scripting (Detected by phrase)

Matched on "Cross-site Scripting"

What is this? (2min video)

Cross-site scripting vulnerabilities occur when unescaped input is rendered into a page displayed to the user. When HTML or script is included in the input, it will be processed by a user's browser as HTML or script and can alter the appearance of the page or execute malicious scripts in their user context.

Try a challenge in Secure Code Warrior

Helpful references

Micro-Learning Topic: DOM-based cross-site scripting (Detected by phrase)

Matched on "DOM-Based Cross Site Scripting"

What is this? (2min video)

DOM-based cross-site scripting vulnerabilities occur when unescaped input is processed by client-side script and insecurely written into the page Document Object Model (DOM). This will result in immediate changes to the page, potentially without any call to the server. When HTML or script is included in the input, it will be processed by a user's browser as HTML or script and can alter the appearance of the page or execute malicious scripts in their user context.

Try a challenge in Secure Code Warrior

Micro-Learning Topic: Reflected cross-site scripting (Detected by phrase)

Matched on "Reflected Cross-Site Scripting"

What is this? (2min video)

Reflected cross-site scripting vulnerabilities occur when unescaped input is displayed in the resulting page displayed to the user. When HTML or script is included in the input, it will be processed by a user's browser as HTML or script and can alter the appearance of the page or execute malicious scripts in their user context.

Try a challenge in Secure Code Warrior

Micro-Learning Topic: Stored cross-site scripting (Detected by phrase)

Matched on "Stored Cross Site Scripting"

What is this? (2min video)

Stored cross-site scripting vulnerabilities happen when unescaped input is displayed by the application after successful storage in persistence layers (e.g. database or cache). When HTML or script is included in the input that is stored in the database, and is then rendered into a page without escaping or encoding, it will be processed by a user's browser as HTML or script and can alter the appearance of the page or execute malicious scripts in their user context.

Try a challenge in Secure Code Warrior

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