CVE-2024-27285
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.
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
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 Medium
CVSS: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 Medium
CVSS: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:
- Gain access to the generated Yard Doc.
- Locate and access the "frames.html" file.
- Construct a URL containing the malicious payload in the hash segment, for instance:
#!javascript:xssfor v0.9.34, and#:javascript:xssfor 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 Medium
CVSS: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 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N - CVSS 3.1
- 6.1 Medium
CVSS: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 Medium
CVSS: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 Medium
CVSS: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:
- Gain access to the generated Yard Doc.
- Locate and access the "frames.html" file.
- Construct a URL containing the malicious payload in the hash segment, for instance:
#!javascript:xssfor v0.9.34, and#:javascript:xssfor 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 Medium
CVSS: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 Medium
CVSS: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 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - CVSS 3.1
- 5.4 Medium
CVSS: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
| Package | Affected | Fixed |
|---|---|---|
yardRubyGems |
before 0.9.36 | 0.9.36 |
yardDebian:12 |
before 0.9.28-2+deb12u2, plus listed versions 0.9.28-20.9.28-2+deb12u1 |
0.9.28-2+deb12u2 |
yardDebian:13 |
before 0.9.36-1 | 0.9.36-1 |
yardDebian:14 |
before 0.9.36-1 | 0.9.36-1 |
yardDebian: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 |
yardDebian:11 |
before 0.9.24-1+deb11u1, plus listed versions 0.9.24-1 |
0.9.24-1+deb11u1 |
yardRubyGems |
before 0.9.36, plus listed versions 0.2.00.2.10.2.20.2.30.2.3.2 Show 45 moreShow less0.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-yardopenEuler:20.03-LTS-SP1 |
before 0.9.26-2.oe1 | 0.9.26-2.oe1 |
rubygem-yardopenEuler:20.03-LTS-SP4 |
before 0.9.26-2.oe2003sp4 | 0.9.26-2.oe2003sp4 |
rubygem-yardopenEuler:22.03-LTS |
before 0.9.26-3.oe2203sp3 | 0.9.26-3.oe2203sp3 |
Show 11 moreShow less
| Package | Affected | Fixed |
|---|---|---|
rubygem-yardopenEuler:22.03-LTS-SP1 |
before 0.9.26-3.oe2203sp1 | 0.9.26-3.oe2203sp1 |
rubygem-yardopenEuler:22.03-LTS-SP2 |
before 0.9.26-3.oe2203sp2 | 0.9.26-3.oe2203sp2 |
rubygem-yardopenEuler:22.03-LTS-SP3 |
before 0.9.26-3.oe2203sp3 | 0.9.26-3.oe2203sp3 |
yardUbuntu: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 |
yardUbuntu: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 |
yardUbuntu: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 |
yardUbuntu:22.04:LTS |
before 0.9.26-1ubuntu0.1, plus listed versions 0.9.24-10.9.26-1 |
0.9.26-1ubuntu0.1 |
yardUbuntu: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 |
yardUbuntu: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 |
yardUbuntu: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 |
yardUbuntu: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
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| first indexed | CVE 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
github.com/lsegal/yard/security/advisories/GHSA-8mq4-9jjh-9xrc
github.com/lsegal/yard/pull/1538
github.com/lsegal/yard/commit/1fcb2d8b316caf8779cfdcf910715e9ab583f0aa
github.com/lsegal/yard/commit/2069e2bf08293bda2fcc78f7d0698af6354054be
github.com/rubysec/ruby-advisory-db/blob/master/gems/yard/CVE-2024-27285.yml
lists.debian.org/debian-lts-announce/2024/03/msg00006.html
Show 16 moreShow less
lists.fedoraproject.org/archives/list/[email protected]/message/MR3Z2E2UIZZ7YOR7R645EVSBGWMB2RGA
nvd.nist.gov/vuln/detail/CVE-2024-27285
github.com/advisories/GHSA-8mq4-9jjh-9xrc
github.com/CVEProject/cvelistV5/tree/main/cves/2024/27xxx/CVE-2024-27285.json
security-tracker.debian.org/tracker/CVE-2024-27285
github.com/lsegal/yard
openeuler.org/en/security/safety-bulletin/detail.html?id=openEuler-SA-2024-1256
ubuntu.com/security/CVE-2024-27285
github.com/lsegal/yard/commit/d78fc393d603c4fc35975969296ed381146a29d4
github.com/lsegal/yard/commit/c88406e4b78f8dd4ba38c79eea0bcec716dbbef8
github.com/lsegal/yard/commit/2a0b9990b64ceeeb0456177c593e36e204a06df1
github.com/lsegal/yard/commit/a831a596b2a7cabdd2e17855dd179af2ebf3d559
cve.org/CVERecord?id=CVE-2024-27285
ubuntu.com/security/notices/USN-6731-1
ubuntu.com/security/CVE-2017-17042
ubuntu.com/security/CVE-2019-1020001
Left out here: 40 versions. The JSON record has them.