Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#263 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
desktop, security

Research direction

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.

Written by the indexing model from the issue text.

Description

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.

Dominant language
TypeScript
Stars
2
Forks
2
Avg merge
5h 28m
Merged PRs (30d)
24

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PierrunoYT/patch

All issues in PierrunoYT/patch

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.