⬆️ Upgrade dependency yard to v0.9.44 [SECURITY] - #1387
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.9.43→0.9.44YARD static cache reads raw traversal paths before router sanitization
CVE-2026-49342 / GHSA-pxcc-8665-phx8
More information
Details
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.htmlis joined against that root and can return a readable sibling.htmlfile 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
--docrootCLI option stores the configured directory inserver_options[:DocumentRoot]atlib/yard/cli/server.rb:198, and adapter initialization copies that value intoadapter.document_rootatlib/yard/server/adapter.rb:76. For Rack requests,RackAdapter#callbuilds a request object from the Rack environment atlib/yard/server/rack_adapter.rb:58and passes it torouter.call(request)atlib/yard/server/rack_adapter.rb:60.Router#callthen stores the incoming request atlib/yard/server/router.rb:55and invokescheck_static_cachebefore normal routing atlib/yard/server/router.rb:56. Insidecheck_static_cache, the only initial guard is thatadapter.document_rootis present atlib/yard/server/static_caching.rb:35; the cache path is built fromFile.join(adapter.document_root, request.path.sub(/\.html$/, '') + '.html')atlib/yard/server/static_caching.rb:36, without cleaning..components first. If that resolved path is a regular file,File.file?accepts it atlib/yard/server/static_caching.rb:38and the file bytes are returned as a200HTML response atlib/yard/server/static_caching.rb:40. The later route sanitizer infinal_optionsusesFile.cleanpath(...).gsub(...)atlib/yard/server/router.rb:181andlib/yard/server/router.rb:182, but a static-cache hit returns before that code is reached.PoC
poc.zip
expected output:
The
YARD_STATIC_CACHE_PATH_TRAVERSALfingerprint is emitted only after the PoC observes a200static-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/--docrootenabled can request.htmlpaths containing parent-directory components and receive readable matching files outside the configured document root. The required guards are narrow:adapter.document_rootmust be set, the traversed target must exist as a regular readable file, and the target must be reachable through the implementation's forced.htmlsuffix. Those requests bypass the laterfinal_optionspath cleanup because the cache check runs first. The resulting severity class is information disclosure: response bodies can contain off-root.htmlfile contents, but this path does not show write access, code execution, or arbitrary files without the.htmlconstraint.Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Configuration
📅 Schedule: (in timezone Europe/Paris)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.