Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

security: redact the user's own stored API keys by exact match

Đã đóng
#263 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
30/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
desktop, security

Hướng nghiên cứu

Start with redactSecrets in src/main/tools/redact.ts, then the app log's redact function and streamRedactor, to see where existing redaction runs and where a key split across chunks would slip through. Settings key loading in the main process is the source for the exact-match list, which must stay out of the renderer. Done means unit tests with a synthetic stored key in an unknown format pass for tool results, two-chunk streamed output and a log entry, while ordinary text is unchanged.

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

Mô tả

enhancement priority: low security severity: low

Follow-up to #153.

Today

redactSecrets (src/main/tools/redact.ts) and the app log's redact recognize known token formats, URL passwords and credential-named .env lines. A key in a format none of them know reaches the model, the transcript and saved chats.

Proposal

Also replace exact occurrences of the keys the user saved in Settings (Anthropic, OpenAI, OpenRouter, search keys), which catches any format for the secrets Patch itself holds:

  • The main process already has the decrypted keys; build the list when they change, never send it to the renderer.
  • Skip values shorter than ~16 characters to avoid redacting ordinary text.
  • Apply in tool results, streaming command output (streamRedactor, including a key split across chunks) and the app log.

Test

Unit tests with a synthetic stored key in an unknown format: redacted in a tool result, in streamed output split across two chunks, and in a log entry; ordinary text unchanged.

Ngôn ngữ chính
TypeScript
Star
2
Fork
2
Merge trung bình
3 giờ 50 phút
Pull request đã merge (30 ngày)
67

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 PierrunoYT/patch

Tất cả issue của PierrunoYT/patch

Issue tương tự

Thêm issue về TypeScript

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.