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

Đang mở Phù hợp với người mới
#3,621 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
74/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp
Lĩnh vực
cli

Hướng nghiên cứu

Bắt đầu tại ConsoleCommandInput.ReadLineAsync, thứ đọc Console.In và được nêu trong báo cáo là nơi dấu vẫn tồn tại; cũng kiểm tra các caller của nó trong các đường dẫn user create và user reset-password --password-stdin dưới src/FluentCMS.Host. Tái hiện bằng cách pipe một dòng có tiền tố BOM vào lệnh, sau đó loại bỏ U+FEFF ở đầu khỏi dòng đầu tiên đọc từ đầu vào được chuyển hướng và giải mã phần còn lại dưới dạng UTF-8. Hoàn tất nghĩa là pipe có tiền tố BOM đăng nhập được và các bài kiểm thử lệnh host hiện có vẫn pass; thêm một bài kiểm thử bao phủ trường hợp BOM.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
C#
Star
567
Fork
107
Merge trung bình
2 giờ 35 phút
Pull request đã merge (30 ngày)
425

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của fluentcms/FluentCMS

Tất cả issue của fluentcms/FluentCMS

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.