Skip to content

Conversation

@depfu
Copy link

@depfu depfu bot commented Sep 24, 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?

↗️ webrick (indirect, 1.7.0 → 1.8.2) · Repo

Security Advisories 🚨

🚨 HTTP Request Smuggling in ruby webrick

An issue was discovered in the WEBrick toolkit through 1.8.1 for Ruby. It allows HTTP request smuggling by providing both a Content-Length header and a Transfer-Encoding header, e.g., "GET /admin HTTP/1.1\r\n" inside of a "POST /user HTTP/1.1\r\n" request. NOTE: the supplier's position is "Webrick should not be used in production."

Sorry, we couldn't find anything useful about this release.

✳️ yard (0.9.28 → 0.9.37) · 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":
(v0.9.34)

<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>

(v0.9.35)

<script type="text/javascript">
  var match = decodeURIComponent(window.location.hash).match(/^#!(.+)/);
  var name = match ? match[1] : '<%= url_for_main %>';
  name = name.replace(/^((\w*):)?[\/\\]*/gm, '').trim();
  window.top.location.replace(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 for v0.9.34, and #:javascript:xss for v0.9.35

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.37

  • Fix JavaScript errors in --one-file template (#1426)
  • Fix heredoc parsing and add support for squiggly heredocs (#1315, #1495)
  • Accessibility improvements to the default template (#1501)
  • Improved YARD documentation (#1410, #1512, #1516, #1544)
  • Fix error when parsing @option tags (#1515)
  • Fix issue parsing UTF-8 filenames (#1517)
  • Replace OpenStruct with optimized YARD::OpenStruct to avoid ostruct performance warnings (#1545)
  • Add support for private attr_* syntax (#1541)
  • Remove logger dependency (#1546)

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.


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 Sep 24, 2024
@codecov
Copy link

codecov bot commented Sep 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.702%. Comparing base (d2b8bcf) to head (2b7ffed).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #312   +/-   ##
=========================================
  Coverage   95.702%   95.702%           
=========================================
  Files          311       311           
  Lines         2955      2955           
=========================================
  Hits          2828      2828           
  Misses         127       127           
Flag Coverage Δ
95.702% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

1 participant