Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions gems/gemstash/GHSA-27cp-f4p8-8qwv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
gem: gemstash
library: rubygems
ghsa: 27cp-f4p8-8qwv
url: https://github.com/rubygems/gemstash/security/advisories/GHSA-27cp-f4p8-8qwv
title: Gemstash vulnerable to unauthenticated remote code execution
via unsafe deserialization of upstream dependency responses
date: 2026-11-19
description: |
## Summary

Gemstash lets any unauthenticated client choose the upstream gem
server, and it loads that server's dependency response with Marshal.load.
An attacker who can reach a gemstash server over HTTP can execute
code as the gemstash process. All releases from 1.0.0.pre.1 through
2.8.2 are affected in their default configuration.

## Impact

Unauthenticated remote code execution (CWE-502) with the privileges
of the user running gemstash. The attacker can read and modify
everything that process can: cached gems, private gems, API keys,
and any credentials in the gemstash configuration. Because gemstash
serves gems to developer, CI, and deploy machines, the attacker
can also alter the gems it serves and extend the compromise to
those systems. Any client that can reach the server can exploit
it, including clients on an internal network.
cvss_v4: 10.0
patched_versions:
- ">= 2.9.0"
related:
url:
- https://rubygems.org/gems/gemstash/versions/2.9.0
- https://github.com/rubygems/gemstash/releases/tag/v2.9.0
- https://github.com/rubygems/gemstash/compare/v2.8.2...v2.9.0
- https://github.com/rubygems/gemstash/security/advisories/GHSA-27cp-f4p8-8qwv
notes: |
- No CVE in GHSA URL.
- cvss_v4 from GHSA URL.
46 changes: 46 additions & 0 deletions gems/gemstash/GHSA-7frx-567x-v3r6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
gem: gemstash
library: rubygems
ghsa: 7frx-567x-v3r6
url: https://github.com/rubygems/gemstash/security/advisories/GHSA-7frx-567x-v3r6
title: Private dependencies API returns private gem metadata
without authentication when :protected_fetch is enabled
date: 2026-11-19
description: |
## Summary

With :protected_fetch: true, Gemstash requires a fetch API key to
download private gems (/private/gems/<name>-<version>.gem), gemspecs
(/private/quick/Marshal.4.8/...) and the specs indexes
(/private/specs.4.8.gz and friends). The private dependencies API
doesn't check it. GET /private/api/v1/dependencies?gems=... and GET
/private/api/v1/dependencies.json?gems=... return the versions,
platforms and runtime dependencies of any private gem to an
unauthenticated client.

## Impact

Any client that can reach the server can enumerate the private catalog
without a key. The client asks for a gem name and gets every indexed
version, its platform, and the names and requirements of its runtime
dependencies. Each response names further gems to ask about, so
following them maps out the private gems and their internal dependencies.
That's useful reconnaissance for dependency-confusion or typosquatting
attacks against the organization. Gem contents and gemspecs stay protected.

This doesn't fall under the SECURITY.md exclusion for unauthenticated
downloads while :protected_fetch is off: it happens with :protected_fetch on.
cvss_v4: 6.9
unaffected_versions:
- "< 1.1.0"
patched_versions:
- ">= 2.9.0"
related:
url:
- https://rubygems.org/gems/gemstash/versions/2.9.0
- https://github.com/rubygems/gemstash/releases/tag/v2.9.0
- https://github.com/rubygems/gemstash/compare/v2.8.2...v2.9.0
- https://github.com/rubygems/gemstash/security/advisories/GHSA-7frx-567x-v3r6
notes: |
- No CVE in GHSA URL.
- cvss_v4 from GHSA URL.
34 changes: 34 additions & 0 deletions gems/gemstash/GHSA-c927-fwqw-cm2g.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
gem: gemstash
library: rubygems
ghsa: c927-fwqw-cm2g
url: https://github.com/rubygems/gemstash/security/advisories/GHSA-c927-fwqw-cm2g
title: Gemstash holds upstream responses of any size in memory (DoS)
date: 2026-11-19
description: |
## Summary

Every response from an upstream gem source is read into memory in
full before it is checked, stored or passed on, and nothing limits
its size. Because a client chooses the upstream by default, anyone
who can reach a Gemstash server can point it at a server that
answers with a very large or endless body.

## Impact

A handful of concurrent requests exhaust the memory of the Gemstash
process and take the server down, stopping installs, builds and
deploys that depend on it. With trusted upstreams only, a single
oversized gem has the same effect.
cvss_v4: 8.7
patched_versions:
- ">= 2.9.0"
related:
url:
- https://rubygems.org/gems/gemstash/versions/2.9.0
- https://github.com/rubygems/gemstash/releases/tag/v2.9.0
- https://github.com/rubygems/gemstash/compare/v2.8.2...v2.9.0
- https://github.com/rubygems/gemstash/security/advisories/GHSA-c927-fwqw-cm2g
notes: |
- No CVE in GHSA URL.
- cvss_v4 from GHSA URL.
57 changes: 57 additions & 0 deletions gems/gemstash/GHSA-m64f-hhmc-w7qr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
gem: gemstash
library: rubygems
ghsa: m64f-hhmc-w7qr
url: https://github.com/rubygems/gemstash/security/advisories/GHSA-m64f-hhmc-w7qr
title: Rejected push to a yanked private gem version overwrites
the stored .gem and gemspec, bypassing yank
date: 2026-11-19
description: |
## Summary

Gemstash::GemPusher#serve writes the uploaded .gem and gemspec to
storage before it checks the database to see whether the version
may be pushed. When the version has been yanked, the database check
correctly raises YankedVersionError and the client gets 422. By
then the attacker's bytes have already replaced the stored files
and the storage indexed flag is set back to true. Nothing rolls this back.

The private fetch endpoints decide whether a version is yanked from
that storage flag, not from the database. So after the rejected
push, GET /private/gems/<name>-<version>.gem and GET
/private/quick/Marshal.4.8/<name>-<version>.gemspec.rz serve the
attacker's content for a version that maintainers yanked. The
original content can't be restored through the API either, because
every later push of that version is also rejected.

## Impact

Anyone holding an API key with push permission can replace the content
served for any yanked version of any private gem. They don't need
yank permission or ownership of the gem, because gemstash keys
aren't scoped per gem. The server returns 422 Version already
exists, so the overwrite doesn't show up in client output or
request logs as a successful push.

Yank is the documented way to pull a bad release, for example one
that leaked a secret or contained malicious code. Unyank was removed
in 2.0.0, so a yanked version is meant to stay dead. With this bug,
a yanked version comes back serving attacker-chosen code to any
client or mirror that fetches it by its direct URL. The real content
can't be put back through the API afterwards.

This doesn't depend on :protected_fetch being off. With
:protected_fetch: true, any client holding a fetch key gets
the attacker's bytes (shown below).
cvss_v4: 5.3
patched_versions:
- ">= 2.9.0"
related:
url:
- https://rubygems.org/gems/gemstash/versions/2.9.0
- https://github.com/rubygems/gemstash/releases/tag/v2.9.0
- https://github.com/rubygems/gemstash/compare/v2.8.2...v2.9.0
- https://github.com/rubygems/gemstash/security/advisories/GHSA-m64f-hhmc-w7qr
notes: |
- No CVE in GHSA URL.
- cvss_v4 from GHSA URL.
36 changes: 36 additions & 0 deletions gems/gemstash/GHSA-v438-gm7r-2pgf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
gem: gemstash
library: rubygems
ghsa: v438-gm7r-2pgf
url: https://github.com/rubygems/gemstash/security/advisories/GHSA-v438-gm7r-2pgf
title: Gemstash serves upstream content as HTML (stored XSS)
date: 2026-11-19
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.
cvss_v4: 5.1
patched_versions:
- ">= 2.9.0"
related:
url:
- https://rubygems.org/gems/gemstash/versions/2.9.0
- https://github.com/rubygems/gemstash/releases/tag/v2.9.0
- https://github.com/rubygems/gemstash/compare/v2.8.2...v2.9.0
- https://github.com/rubygems/gemstash/security/advisories/GHSA-v438-gm7r-2pgf
notes: |
- No CVE in GHSA URL.
- cvss_v4 from GHSA URL.
28 changes: 28 additions & 0 deletions gems/gemstash/GHSA-wgrc-4g2v-9qxv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
gem: gemstash
library: rubygems
ghsa: wgrc-4g2v-9qxv
url: https://github.com/rubygems/gemstash/security/advisories/GHSA-wgrc-4g2v-9qxv
title: Gem push reads the whole request body into memory before
checking the API key
date: 2026-11-19
description: |
## Summary

POST /private/api/v1/gems reads the entire request body into memory
before checking the API key. An unauthenticated client can make the
server allocate memory in proportion to the size of the upload,
and the request is only rejected with a 401 afterwards. There is
no limit on the body size.
cvss_v4: 6.9
patched_versions:
- ">= 2.9.0"
related:
url:
- https://rubygems.org/gems/gemstash/versions/2.9.0
- https://github.com/rubygems/gemstash/releases/tag/v2.9.0
- https://github.com/rubygems/gemstash/compare/v2.8.2...v2.9.0
- https://github.com/rubygems/gemstash/security/advisories/GHSA-wgrc-4g2v-9qxv
notes: |
- No CVE in GHSA URL.
- cvss_v4 from GHSA URL.
37 changes: 37 additions & 0 deletions gems/gemstash/GHSA-xfw4-3v4j-82mr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
gem: gemstash
library: rubygems
ghsa: xfw4-3v4j-82mr
url: https://github.com/rubygems/gemstash/security/advisories/GHSA-xfw4-3v4j-82mr
title: Gemstash lets any client choose the upstream it fetches
from (SSRF, open redirect)
date: 2026-11-19
description: |
## Summary

Gemstash fetches from, or redirects to, whichever gem source a client
names, with the X-Gemfile-Source header that Bundler sends when
Gemstash is used as a mirror, or with an /upstream/<url>/ or
/redirect/<url>/ path prefix. The URL is not checked. Anyone who
can reach a Gemstash server can make it send GET requests to any
host the server can reach and read the response, or build a URL
on the server that redirects to any site.

## Impact

SSRF with the response returned to the client: loopback services,
the internal network, cloud metadata endpoints. Open redirect from
the Gemstash origin. Attacker-chosen content stored under a gem
name. TLS silently dropped on a redirected download.
cvss_v4: 7.8
patched_versions:
- ">= 2.9.0"
related:
url:
- https://rubygems.org/gems/gemstash/versions/2.9.0
- https://github.com/rubygems/gemstash/releases/tag/v2.9.0
- https://github.com/rubygems/gemstash/compare/v2.8.2...v2.9.0
- https://github.com/rubygems/gemstash/security/advisories/GHSA-xfw4-3v4j-82mr
notes: |
- No CVE in GHSA URL.
- cvss_v4 from GHSA URL.
34 changes: 34 additions & 0 deletions gems/gemstash/GHSA-xg28-cqw2-pggq.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
gem: gemstash
library: rubygems
ghsa: xg28-cqw2-pggq
url: https://github.com/rubygems/gemstash/security/advisories/GHSA-xg28-cqw2-pggq
title: Gemstash caches and serves unvalidated dependency data from an upstream
date: 2026-11-19
description: |
## Summary

The dependency data Gemstash fetches from an upstream with
/api/v1/dependencies.json is cached and handed to clients, as JSON
or as a Marshal dump Gemstash builds. It was cached and passed on
as it came: entries of any shape, with any extra fields, and
entries for gems that were never requested were all accepted and cached.

## Impact

Limited: the cache is kept per gem source, so only clients using that
same source see the data, and JSON cannot produce Ruby objects. It
still lets an upstream plant arbitrary structures and unrequested
gems into the Gemstash cache and into what its clients deserialize.
cvss_v4: 6.3
patched_versions:
- ">= 2.9.0"
related:
url:
- https://rubygems.org/gems/gemstash/versions/2.9.0
- https://github.com/rubygems/gemstash/releases/tag/v2.9.0
- https://github.com/rubygems/gemstash/compare/v2.8.2...v2.9.0
- https://github.com/rubygems/gemstash/security/advisories/GHSA-xg28-cqw2-pggq
notes: |
- No CVE in GHSA URL.
- cvss_v4 from GHSA URL.