RubySec

Providing security resources for the Ruby community

GHSA-v438-gm7r-2pgf (gemstash): Gemstash serves upstream content as HTML (stored XSS)

Gemstash serves upstream content as HTML (stored XSS)

Published: November 19, 2026

SECURITY IDENTIFIERS

GEM

gemstash

LIBRARY

RubyGems

PATCHED VERSIONS

>= 2.9.0

DESCRIPTION

Summary

Gemstash replayed the Content-Type an upstream sent with a gem or gemspec on every request for the stored file, and served spec indexes with no content type of its own, so Sinatra's default text/html applied to whatever the upstream returned. Because clients choose the upstream, anyone could have Gemstash serve HTML from a server they control, on the Gemstash origin.

Impact

Attacker-chosen script runs in the browser of anyone who opens such a URL, on the Gemstash origin that also serves private gems and the dependency API. Gemstash has no browser sessions, which limits what the script can reach. A gem stored this way stays poisoned until it is deleted from the base path.

RELATED