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

Update dependency yard to v0.9.36 [SECURITY] #2281

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Feb 28, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
yard (source) 0.9.28 -> 0.9.36 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2024-27285

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

lsegal/yard (yard)

v0.9.36

Compare Source

v0.9.35

Compare Source

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

v0.9.34

Compare Source

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

v0.9.33

Compare Source

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

v0.9.32

Compare Source

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

v0.9.31

Compare Source

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

v0.9.30

Compare Source

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

v0.9.29

Compare Source


Configuration

📅 Schedule: Branch creation - "" in timezone Europe/London, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot added the security An issue with the security of the service label Feb 28, 2024
@renovate renovate bot force-pushed the renovate/rubygems-yard-vulnerability branch from 96c4b95 to 3c13c2c Compare March 1, 2024 03:57
@renovate renovate bot changed the title Update dependency yard to v0.9.35 [SECURITY] Update dependency yard to v0.9.36 [SECURITY] Mar 1, 2024
@renovate renovate bot force-pushed the renovate/rubygems-yard-vulnerability branch from 3c13c2c to 21040a1 Compare March 3, 2024 12:34
@r-ferrier r-ferrier merged commit 37db8cb into main Mar 6, 2024
2 checks passed
@r-ferrier r-ferrier deleted the renovate/rubygems-yard-vulnerability branch March 6, 2024 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
security An issue with the security of the service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant