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

🚨 [security] Update yard 0.9.28 → 0.9.36 (minor) #293

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

Conversation

depfu[bot]
Copy link

@depfu depfu bot commented Mar 2, 2024


Welcome to Depfu 👋

This is one of the first three pull requests with dependency updates we've sent your way. We tried to start with a few easy patch-level updates. Hopefully your tests will pass and you can merge this pull request without too much risk. This should give you an idea how Depfu works in general.

After you merge your first pull request, we'll send you a few more. We'll never open more than seven PRs at the same time so you're not getting overwhelmed with updates.

Let us know if you have any questions. Thanks so much for giving Depfu a try!



🚨 Your current dependencies have known security vulnerabilities 🚨

This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!


Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ yard (0.9.28 → 0.9.36) · Repo · Changelog

Security Advisories 🚨

🚨 YARD's default template vulnerable to Cross-site Scripting in generated frames.html

Summary

The "frames.html" file within the Yard Doc's generated documentation
is vulnerable to Cross-Site Scripting (XSS) attacks due to inadequate
sanitization of user input within the JavaScript segment of the
"frames.erb" template file.

Details

The vulnerability stems from mishandling user-controlled data retrieved
from the URL hash in the embedded JavaScript code within the "frames.erb"
template file. Specifically, the script lacks proper sanitization of
the hash data before utilizing it to establish the top-level window's
location. This oversight permits an attacker to inject malicious
JavaScript payloads through carefully crafted URLs.

Snippet from "frames.erb":

<script type="text/javascript">
  var match = unescape(window.location.hash).match(/^#!(.+)/);
  var name = match ? match[1] : '<= url_for_main >';
  name = name.replace(/^(\w+):\/\//, '').replace(/^\/\//, '');
  window.top.location = name;
</script>

PoC (Proof of Concept)

To exploit this vulnerability:

  1. Gain access to the generated Yard Doc.
  2. Locate and access the "frames.html" file.
  3. Construct a URL containing the malicious payload in the hash
    segment, for instance: #!javascript:xss

Impact

This XSS vulnerability presents a substantial threat by enabling
an attacker to execute arbitrary JavaScript code within the user's
session context. Potential ramifications include session hijacking,
theft of sensitive data, unauthorized access to user accounts, and
defacement of websites. Any user visiting the compromised page is
susceptible to exploitation. It is critical to promptly address
this vulnerability to mitigate potential harm to users and preserve
the application's integrity.

Release Notes

0.9.36

  • Further XSS fixes for generated frameset pages (#1538)
  • Improve tests for Ruby 3.3 compatibility (#1519, #1531)
  • Documentation improvements (#1524)

0.9.35

  • Fix possible XSS on generated YARD frameset pages (thanks to @RedYetiDev for finding and patching) (2069e2b).
  • Fix errors when using @option on non-method objects (#1508)
  • Support Ruby 3.3 changes in Ripper parser (#1510)

0.9.34

  • Add changelog to yard.gemspec
  • Fix fork behavior in yard server --fork

0.9.33

  • Ensure .yardopts is present in gem package (internal YARD documentation change)

0.9.32

  • Fix issue with custom Rack::Request attributes in yard server

0.9.31

  • Remove dependency on webrick in YARD::Server::Commands::StaticFileHelpers

0.9.30

  • Hot release fix to correct issue with gem packaging missing templates (#1490)

0.9.29

  • Enable table support for CommonMarker (#1443)
  • Parser performance improvements (#1452, #1453, #1454, #1455)
  • Fix autoload of RipperParser (#1460)
  • Remove dependency on webrick for better Ruby 3.1+ support
  • Improvements for mixin resolution (#1467, #1468)

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

🗑️ webrick (removed)


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu cancel merge
Cancels automatic merging of this PR
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

@depfu depfu bot added the depfu label Mar 2, 2024
Copy link

codecov bot commented Mar 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.702%. Comparing base (d2b8bcf) to head (06ddb33).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #293   +/-   ##
=========================================
  Coverage   95.702%   95.702%           
=========================================
  Files          311       311           
  Lines         2955      2955           
=========================================
  Hits          2828      2828           
  Misses         127       127           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

None yet

0 participants