Should gem sources and gem env redact credentials embedded in source URLs?
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
Línea de trabajo
Comienza con Gem::Commands::SourcesCommand y Gem::Commands::EnvironmentCommand; después, ejecuta la reproducción aislada de GEMRC del issue para inspeccionar cada ruta de salida de la gestión de fuentes y del entorno. Se considera terminado cuando las salidas indicadas ya no exponen información de usuario de la URI y el comportamiento se ha comprobado de forma coherente con el tratamiento existente de Gem::Uri.redact.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the problem as clearly as you can
This issue is a question about the expected output of RubyGems source inspection commands.
RubyGems supports HTTP Basic authentication through URI userinfo. Issue #2456 documents credentials in a source URL as the existing way to authenticate downloads. PR #4868 later added credential redaction to download logs, errors, and debug output.
However, the current source management paths still print the original URI:
- successful
gem sources --add,--prepend, and--appendoutput; gem sources;gem env remotesources;- the configuration and remote-sources sections of the full
gem envoutput.
When a configured source contains https://username:[email protected]/, these commands display the complete userinfo. This can copy a long-lived credential into terminal output, CI logs, support reports, or other diagnostics.
The credential is already stored in gemrc as part of the configured source, so redacting command output would not change the on-disk storage model. This question is specifically about avoiding additional disclosure through output.
I could not find an existing issue or Discussion addressing this exact behavior. Discussion #6136 concerns Bundler credential storage rather than RubyGems source display. The command reference describes private sources but does not document how source userinfo is displayed.
Is displaying the exact source URI intentional for these inspection commands? If it is, would a documentation warning be appropriate? If it is not, would maintainers accept using Gem::Uri.redact consistently for source-management and environment output, as the network paths already do?
Did you try upgrading RubyGems?
Yes. I verified the relevant paths in RubyGems 4.0.19 and current master at a443fab01e388cbd97707a1bdddc1a112832a9e3.
Post steps to reproduce the problem
A network request is not needed to reproduce the listing behavior:
tmp=$(mktemp)
printf "%s\n" ":sources:" "- https://example-user:[email protected]/" > "$tmp"
GEMRC="$tmp" gem sources
GEMRC="$tmp" gem env remotesources
A successful gem sources --add against an authenticated private source also echoes the complete source URI after saving it.
Which command did you run?
gem sources
gem env remotesources
gem env
What were you expecting to happen?
Either URI userinfo would be redacted consistently with RubyGems network logs and errors, or the documentation would explicitly state that source inspection commands display embedded credentials.
If embedding credentials in source URLs is considered a legacy or compatibility-only authentication mechanism, I would also expect the documentation to say so explicitly, explain the disclosure risks, and point users to the recommended alternative. If it remains the supported mechanism for authenticated gem downloads, redacting credentials from diagnostic output seems especially important.
For example:
https://example-user:[email protected]/
What actually happened?
The full configured URI was printed:
https://example-user:[email protected]/
Run gem env and paste the output below
This behavior is not platform-specific and is directly visible in the current implementations of Gem::Commands::SourcesCommand and Gem::Commands::EnvironmentCommand. The reproduction above uses an isolated GEMRC and contains no real credentials.
- Lenguaje dominante
- Ruby
- Estrellas
- 4k
- Forks
- 2k
- Merge medio
- 1 d 17 h
- PR fusionados (30 d)
- 50
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ruby/rubygems
-
Bundler 4.0.x fails on Ruby 4.1 when .bundle/config is "---"Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
Los mantenedores suelen responder en 1 día
-
Cooldown drops the locked version of a gem named in bundle lock --update or bundle updatePosiblemente ocupada @senid231 la tomó hace 4 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
Profiling `require "bundler/setup"` in a 450-gem app: 13 findings, a series of small PRsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 15/100
Los mantenedores suelen responder en 1 día
-
Gem::Package::TarReader silently ignores pax/GNU extension headersPosiblemente ocupada @akasakariko la tomó hace 8 días. AbiertoRubyGems
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
ruby/rubygems#9988 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
`Gem::Version.new`, `#bump`, and `#release` do not work in ractorPosiblemente ocupada @mmporong la tomó hace 12 días. AbiertoRubyGems
Dificultad 3/5 Medio día Aptitud para principiantes 55/100
Los mantenedores suelen responder en 1 día
Todos los issues de ruby/rubygems
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
swombat/souls-house#825 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
openhab/openhab-jruby#571 ·
-
Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
chatwoot/chatwoot#16591 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Tags Listing Shows Paging CountAbiertogood first issue User Interface
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
rubyforgood/skillrx#740 ·