CVE-2026-41493
Path Traversal in YARD Documentation Tool
Publication date: 2026-05-08
Last updated on: 2026-05-08
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| lsegal | yard | to 0.9.42 (exc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-22 | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability is a path traversal flaw in YARD, a Ruby documentation tool, affecting versions prior to 0.9.42. When using the yard server to serve documentation, unsanitized HTTP requests can exploit this flaw to access arbitrary files on the server's machine under certain conditions.
The issue arises because the yard server does not properly sanitize file path inputs, allowing attackers to traverse directories and read files outside the intended documentation directory.
This vulnerability has been fixed in version 0.9.42 by correcting the path sanitization.
How can this vulnerability impact me? :
An attacker exploiting this vulnerability can gain unauthorized access to arbitrary files on the server hosting the yard server. This could lead to exposure of sensitive information stored on the server.
If the yard server is used in an untrusted environment without proper safeguards, this flaw could be leveraged to read configuration files, source code, credentials, or other sensitive data.
The severity of this vulnerability is considered moderate.
- Potential data leakage of sensitive files
- Compromise of server confidentiality
- Increased risk if the server is exposed to untrusted networks
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability involves unsanitized HTTP requests to a yard server that allow path traversal to access arbitrary files. Detection can focus on monitoring HTTP requests to the yard server for suspicious path traversal patterns such as '../' sequences or attempts to access files outside the expected documentation root.
Since the vulnerability occurs when using yard server to serve documentation, especially without WEBrick and with the --docroot option, you can check the version of YARD installed and the server startup parameters.
- Check YARD version: `yard --version` (ensure it is 0.9.42 or later)
- Inspect running processes for yard server usage and options: `ps aux | grep yard`
- Monitor HTTP access logs for suspicious requests containing path traversal patterns, e.g., `grep '\.\./' /path/to/yard/server/access.log`
- Use network monitoring tools like tcpdump or Wireshark to capture HTTP traffic to the yard server and filter for suspicious URI patterns.
What immediate steps should I take to mitigate this vulnerability?
The primary mitigation is to upgrade YARD to version 0.9.42 or later, where this path traversal vulnerability has been patched.
If upgrading immediately is not possible, you should ensure that the yard server is run with WEBrick by using the command `yard server -s webrick`, as WEBrick performs path sanitization by default.
Alternatively, implement path sanitization at the webserver level to restrict access to only intended directories and prevent traversal attacks.
Avoid running yard server in untrusted environments without these mitigations.
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
The vulnerability allows unsanitized HTTP requests to access arbitrary files on the server hosting the yard documentation. This unauthorized file access could potentially lead to exposure of sensitive or personal data stored on the server.
Such exposure of sensitive data may impact compliance with data protection regulations like GDPR and HIPAA, which require strict controls on access to personal and protected health information.
Organizations using vulnerable versions of YARD in untrusted environments without proper path sanitization risk violating these standards if unauthorized parties access confidential files.
Mitigation involves upgrading to YARD version 0.9.42 or implementing path sanitization at the webserver level to prevent unauthorized file access.