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

fix(cli): avoid piping secrets through echo when using wrangler secret put

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

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
shell, typescript
Domain
cli, security

Research direction

Start in packages/cli/src/lib/cloudflare.ts and inspect the secret-setting invocation and wranglerArgv entry point. Reproduce the counterscale install or env command with a value containing newlines, $, backticks, and spaces, then verify that the value stored by Cloudflare matches byte-for-byte.

Written by the indexing model from the issue text.

Description

Follow-up from review of #265.

In packages/cli/src/lib/cloudflare.ts, secrets are set via:

await $`echo ${value} | ${this.wranglerArgv()} secret put ${key} --config ${this.configPath}`;

Depending on zx's interpolation/echo behavior, secrets containing newlines, $, backticks, or other shell-special characters can get mangled before they reach wrangler secret put (e.g. CF_PASSWORD_HASH / CF_JWT_SECRET values).

A more robust approach is to pass the secret on stdin without a shell pipeline and without echoing it, e.g. spawn wrangler with input piping, or -e-safe quoting, so arbitrary secret values round-trip byte-for-byte.

Acceptance: setting a secret containing newlines, $, backticks, and spaces via counterscale install / env command results in the identical value stored in Cloudflare.

Dominant language
TypeScript
Stars
2.2k
Forks
136
PR merge metrics
No merged PRs in 30d

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 benvinegar/counterscale

All issues in benvinegar/counterscale

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.