yard

CVE-2026-49342

CVE-2026-49342 is a medium-severity path traversal vulnerability in yard (rubygems), affecting versions < 0.9.44. It is fixed in 0.9.44.

Key facts
CVSS score
5.3
Medium
Attack vector
Network
Issuing authority
GitHub Advisory Database
Affected package
yard
Fixed in
0.9.44
Disclosed
2026

Summary

Summary YARD's static cache lookup reads a request path before the router's path cleanup runs. When a server is configured with a document root, a traversal path such as /../yard-cache-secret.html is joined against that root and can return a readable sibling .html file outside the intended static tree. The potential security risk seems low, as only html-ending files can be read, but still the risk of reading arbitrary html files is a confiendtiality issue in itself, which is why we decided to report. Please let us know if this is out of your project's scope. Details The --docroot CLI option stores the configured directory in serveroptions[:DocumentRoot] at lib/yard/cli/server.rb:198, and adapter initialization copies that value into adapter.documentroot at lib/yard/server/adapter.rb:76. For Rack requests, RackAdapter#call builds a request object from the Rack environment at lib/yard/server/rackadapter.rb:58 and passes it to router.call(request) at lib/yard/server/rackadapter.rb:60. Router#call then stores the incoming request at lib/yard/server/router.rb:55 and invokes checkstaticcache before normal routing at lib/yard/server/router.rb:56. Inside checkstaticcache, the only initial guard is that adapter.documentroot is present at lib/yard/server/staticcaching.rb:35; the cache path is built from File.join(adapter.documentroot, request.path.sub(/\.html$/, '') + '.html') at lib/yard/server/staticcaching.rb:36, without cleaning .. components first. If that resolved path is a regular file, File.file? accepts it at lib/yard/server/staticcaching.rb:38 and the file bytes are returned as a 200 HTML response at lib/yard/server/staticcaching.rb:40. The later route sanitizer in finaloptions uses File.cleanpath(...).gsub(...) at lib/yard/server/router.rb:181 and lib/yard/server/router.rb:182, but a static-cache hit returns before that code is reached. PoC poc.zip expected output: The YARDSTATICCACHEPATHTRAVERSAL fingerprint is emitted only after the PoC observes a 200 static-cache response whose body contains the sibling file outside the configured document root. A setup failure, syntax failure, or cache miss would not print this oracle and would not demonstrate this traversal read. Impact A remote unauthenticated HTTP client who can reach a YARD documentation server with DocumentRoot/--docroot enabled can request .html paths containing parent-directory components and receive readable matching files outside the configured document root. The required guards are narrow: adapter.documentroot must be set, the traversed target must exist as a regular readable file, and the target must be reachable through the implementation's forced .html suffix. Those requests bypass the later final_options path cleanup because the cache check runs first. The resulting severity class is information disclosure: response bodies can contain off-root .html file contents, but this path does not show write access, code execution, or arbitrary files without the .html constraint.

Impact

What is path traversal?

Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files. Typical impact: unauthorized file read or write outside the intended directory.

Severity and exposure

CVE-2026-49342 has a CVSS score of 5.3 (Medium). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment.

A fixed version is available (0.9.44). Upgrading removes the vulnerable code path.

Affected versions

rubygems

  • yard (< 0.9.44)

Security releases

  • yard → 0.9.44 (rubygems)
Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter instead of chasing every advisory.

Kodem's runtime-powered SCA identifies whether CVE-2026-49342 is reachable in your applications. Explore open-source security for your team.

See if CVE-2026-49342 is reachable in your applications. Get a demo

Already deployed Kodem? See CVE-2026-49342 in your environment

Remediation advice

Upgrade yard to 0.9.44 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently asked questions about CVE-2026-49342

What is CVE-2026-49342?

CVE-2026-49342 is a medium-severity path traversal vulnerability in yard (rubygems), affecting versions < 0.9.44. It is fixed in 0.9.44. Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files.

How severe is CVE-2026-49342?

CVE-2026-49342 has a CVSS score of 5.3 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.

Which versions of yard are affected by CVE-2026-49342?

yard (rubygems) versions < 0.9.44 is affected.

Is there a fix for CVE-2026-49342?

Yes. CVE-2026-49342 is fixed in 0.9.44. Upgrade to this version or later.

Is CVE-2026-49342 exploitable, and should I be worried?

Whether CVE-2026-49342 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo

What actually determines whether CVE-2026-49342 is exploitable, and how bad it is?

Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.

How do I fix CVE-2026-49342?

Upgrade yard to 0.9.44 or later.

Stop the waste.
Protect your environment with Kodem.