Every CVE Search/ Get API key

CVE-2024-27285

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

5.4 MediumFix available

YARD is a Ruby Documentation tool. 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. This vulnerability is fixed in 0.9.36.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
Required

What an attacker can affect

Confidentiality
Low
Integrity
Low
Availability
None

Exploit likelihood

1.06%Up 1.0 points since Feb 29, 2024
90%50%10%1%

What each source reports

CVE List Score used 5.4

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

YARD is a Ruby Documentation tool. 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. This vulnerability is fixed in 0.9.36.

Record
CVE-2024-27285
CVSS 3.1
5.4 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
Weakness
CWE-79
Updated
2026-11-02
EUVDEUVD-2024-0579 5.4

YARD is a Ruby Documentation tool. 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. This vulnerability is fixed in 0.9.36.

Record
EUVD-2024-0579
CVSS 3.1
5.4 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
Updated
2026-11-02
GitHub AdvisoriesGHSA-8mq4-9jjh-9xrc 5.4

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.

Record
GHSA-8mq4-9jjh-9xrc
CVSS 3.1
5.4 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
Weakness
CWE-79
Updated
2026-11-02
NVD 5.4

YARD is a Ruby Documentation tool. 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. This vulnerability is fixed in 0.9.36.

Record
CVE-2024-27285
CVSS 3.1
5.4 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
CVSS 3.1
6.1 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Weakness
CWE-79
Updated
2026-11-02
OSV 5.4

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

YARD is a Ruby Documentation tool. 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. This vulnerability is fixed in 0.9.36.

Record
CVE-2024-27285
CVSS 3.1
5.4 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
Weakness
CWE-79
Updated
2026-11-02
OSVDEBIAN-CVE-2024-27285 6.1

YARD is a Ruby Documentation tool. 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. This vulnerability is fixed in 0.9.36.

Record
DEBIAN-CVE-2024-27285
CVSS 3.1
6.1 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Updated
2026-11-02
Show 4 moreShow less
OSVGHSA-8mq4-9jjh-9xrc 5.4

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.

Record
GHSA-8mq4-9jjh-9xrc
CVSS 3.1
5.4 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
Weakness
CWE-79
Updated
2026-11-02
OSVOESA-2024-1256 5.4

rubygem-yard security update

YARD is a documentation generation tool for the Ruby programming language. It enables the user to generate consistent, usable documentation that can be exported to a number of formats very easily, and also supports extending for custom Ruby constructs such as custom class level definitions.

Security Fix(es):

YARD is a Ruby Documentation tool. 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. This vulnerability is fixed in 0.9.36.(CVE-2024-27285)

Record
OESA-2024-1256
CVSS 3.1
5.4 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
Updated
2026-11-02
OSVUBUNTU-CVE-2024-27285 6.1

YARD is a Ruby Documentation tool. 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. This vulnerability is fixed in 0.9.36.

Record
UBUNTU-CVE-2024-27285
CVSS 3.1
6.1 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
CVSS 3.1
5.4 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
Updated
2026-11-02
OSVUSN-6731-1 No score

yard vulnerabilities

It was discovered that YARD before 0.9.11 does not block relative paths with an initial ../ sequence, which allows attackers to conduct directory traversal attacks and read arbitrary files. This issue only affected Ubuntu 16.04 LTS. (CVE-2017-17042)

It was discovered that yard before 0.9.20 is affected by a path traversal vulnerability, allowing HTTP requests to access arbitrary files under certain conditions. This issue only affected Ubuntu 18.04 LTS. (CVE-2019-1020001)

Aviv Keller discovered that 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. (CVE-2024-27285)

Record
USN-6731-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
yard
RubyGems
before 0.9.36
0.9.36
yard
Debian:12
before 0.9.28-2+deb12u2, plus listed versions
0.9.28-20.9.28-2+deb12u1
0.9.28-2+deb12u2
yard
Debian:13
before 0.9.36-1
0.9.36-1
yard
Debian:14
before 0.9.36-1
0.9.36-1
yard
Debian:10
From an advisory covering 2 CVEs
before 0.9.16-1+deb10u1, plus listed versions
0.9.16-1
0.9.16-1+deb10u1
yard
Debian:11
before 0.9.24-1+deb11u1, plus listed versions
0.9.24-1
0.9.24-1+deb11u1
yard
RubyGems
before 0.9.36, plus listed versions
0.2.00.2.10.2.20.2.30.2.3.2
Show 45 moreShow less
0.2.3.30.2.3.40.2.3.50.4.00.5.00.5.10.5.1p10.5.20.5.30.5.40.5.50.5.60.5.70.5.80.6.00.6.10.6.20.6.30.6.40.6.50.6.60.6.70.6.80.7.00.7.10.7.20.7.30.7.40.7.50.8.00.8.10.8.20.8.2.10.8.30.8.40.8.4.10.8.50.8.5.10.8.5.20.8.60.8.6.10.8.6.20.8.70.8.7.10.8.7.2
0.9.36
rubygem-yard
openEuler:20.03-LTS-SP1
before 0.9.26-2.oe1
0.9.26-2.oe1
rubygem-yard
openEuler:20.03-LTS-SP4
before 0.9.26-2.oe2003sp4
0.9.26-2.oe2003sp4
rubygem-yard
openEuler:22.03-LTS
before 0.9.26-3.oe2203sp3
0.9.26-3.oe2203sp3
Show 11 moreShow less
Affected packages
PackageAffectedFixed
rubygem-yard
openEuler:22.03-LTS-SP1
before 0.9.26-3.oe2203sp1
0.9.26-3.oe2203sp1
rubygem-yard
openEuler:22.03-LTS-SP2
before 0.9.26-3.oe2203sp2
0.9.26-3.oe2203sp2
rubygem-yard
openEuler:22.03-LTS-SP3
before 0.9.26-3.oe2203sp3
0.9.26-3.oe2203sp3
yard
Ubuntu:Pro:16.04:LTS
before 0.8.7.6+git20160220-3ubuntu0.1~esm1, plus listed versions
0.8.7.6-10.8.7.6+git20160220-3
0.8.7.6+git20160220-3ubuntu0.1~esm1
yard
Ubuntu:Pro:18.04:LTS
before 0.9.12-2ubuntu0.1~esm1, plus listed versions
0.9.9-10.9.12-10.9.12-1ubuntu30.9.12-2
0.9.12-2ubuntu0.1~esm1
yard
Ubuntu:20.04:LTS
before 0.9.24-1+deb11u1build0.20.04.1, plus listed versions
0.9.16-10.9.20-10.9.24-1
0.9.24-1+deb11u1build0.20.04.1
yard
Ubuntu:22.04:LTS
before 0.9.26-1ubuntu0.1, plus listed versions
0.9.24-10.9.26-1
0.9.26-1ubuntu0.1
yard
Ubuntu:Pro:16.04:LTS
From an advisory covering 3 CVEs
before 0.8.7.6+git20160220-3ubuntu0.1~esm1, plus listed versions
0.8.7.6-10.8.7.6+git20160220-3
0.8.7.6+git20160220-3ubuntu0.1~esm1
yard
Ubuntu:Pro:18.04:LTS
From an advisory covering 3 CVEs
before 0.9.12-2ubuntu0.1~esm1, plus listed versions
0.9.9-10.9.12-10.9.12-1ubuntu30.9.12-2
0.9.12-2ubuntu0.1~esm1
yard
Ubuntu:20.04:LTS
From an advisory covering 3 CVEs
before 0.9.24-1+deb11u1build0.20.04.1, plus listed versions
0.9.16-10.9.20-10.9.24-1
0.9.24-1+deb11u1build0.20.04.1
yard
Ubuntu:22.04:LTS
From an advisory covering 3 CVEs
before 0.9.26-1ubuntu0.1, plus listed versions
0.9.24-10.9.26-1
0.9.26-1ubuntu0.1

History

History
RecordedChangedSources
affected, facts
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2024-27285 is a medium vulnerability (CVSS 5.4) in Lsegal Yard, published February 28, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.06%, the 64th percentile. Fixed in yard 0.9.36.

References

Show 16 moreShow less
This page doesn't list everything

Left out here: 40 versions. The JSON record has them.

MoveEnter Open