SUSE / rmt

RPM repository mirroring tool and registration proxy for SUSE Customer Center.
Other
37 stars 46 forks source link

🚨 [security] Update yard 0.9.25 → 0.9.35 (minor) #1103

Closed depfu[bot] closed 2 months ago

depfu[bot] commented 4 months ago

🚨 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 (indirect, 0.9.25 → 0.9.35) · 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.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)

0.9.28

  • Safe load config YAML files (#1385)
  • Handle empty string constants (#1415)
  • Pre-emptively support removal of Object#taint in Ruby 3.2 (#1419)
  • Fix Ruby 3.1 forward args Ripper change (#1431)

0.9.27

  • Add support for Ruby 3.0 endless method definitions. (#1376, #1381)
  • Add existence check for README file (#1367)
  • Support module_function decorator (#1365)
  • Add CommonMarker markup support (-m commonmarker) (#1157, #1388)
  • Fix nested array parsing (#1389)
  • Add WEBrick as a runtime dependency for Ruby 3.0 support (#1400)
  • Support fail_on_warning option in yard stats command (#1392)
  • Better integration with Sorbet (#1401)
  • Handle include mixins on complex paths (#1386)
  • Fix @!scope maintaining state in lone comment blocks (#1411)
  • Remove support for Travis CI

0.9.26

  • Add support for Ruby 3.0 and fix tests
  • Fix support for frozen_string_literal: false magic comments (#1363)

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)