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.34 → 0.9.35 (minor) #237

Merged
merged 1 commit into from
Mar 30, 2024

Conversation

depfu[bot]
Copy link
Contributor

@depfu depfu bot commented Feb 29, 2024


🚨 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.34 → 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.

Commits

See the full diff on Github. The new version differs by 16 commits:


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 dependencies Pull requests that update a dependency file depfu labels Feb 29, 2024
@depfu depfu bot requested a review from subzero10 February 29, 2024 00:09
Copy link
Contributor Author

depfu bot commented Feb 29, 2024

Sorry, but the merge failed with:

At least 1 approving review is required by reviewers with write access.

@subzero10 subzero10 merged commit 3c01fd5 into main Mar 30, 2024
14 checks passed
@depfu depfu bot deleted the depfu/update/main/yard-0.9.35 branch March 30, 2024 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file depfu
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant