user create --password-stdin keeps a byte order mark as part of the password

Aperta Adatta ai principianti
#3,621 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
74/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
cli

Direzione di ricerca

Inizia da ConsoleCommandInput.ReadLineAsync, che legge Console.In ed è indicato nel report come il punto in cui il marcatore sopravvive; controlla anche i suoi chiamanti nei percorsi user create e user reset-password --password-stdin sotto src/FluentCMS.Host. Riproduci inviando tramite pipe una riga con prefisso BOM al comando, poi rimuovi un U+FEFF iniziale dalla prima riga letta dall'input reindirizzato e decodifica il resto come UTF-8. Fatto significa che la pipe con prefisso BOM effettua l'accesso e i test esistenti dei comandi host continuano a passare; aggiungi un test che copra il caso BOM.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:identity type:bug

What happens

On Windows, a password piped from PowerShell to fluentcms user create --password-stdin (or user reset-password --password-stdin) is stored with a byte order mark in front of it, so the user cannot sign in with the password that was piped:

"YourPassword123!" | dotnet run --no-build --project src/FluentCMS.Host -- fluentcms user create --email [email protected] --role "Super Admin" --password-stdin

The command reports success, and the sign-in page then answers "Sign-in failed" for that address and password. The same command fed from a pipe without a byte order mark (cmd, bash) signs in.

Why

PowerShell can write a UTF-8 byte order mark before what it pipes to a native command. ConsoleCommandInput.ReadLineAsync reads Console.In, which does not drop it, so the first line of standard input is the mark followed by the password.

Expected

A byte order mark at the start of redirected standard input is not part of the first line, and what follows it is read as UTF-8.

Lingua principale
C#
Stelle
567
Fork
107
Merge medio
2h 35m
PR unite (30g)
425

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di fluentcms/FluentCMS

Tutte le issue di fluentcms/FluentCMS

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.