paritytech / paritytech/dotns

[Bug]: --json swallows the shared-dev-account warning, and a typo'd env var silently signs with the public account

Open
#292 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

dotns-sdk P1 type: bug
Dominant language
Solidity
Stars
4
Forks
2
Avg merge
1d 18h
Merged PRs (30d)
24

Description

Component

Other

Priority

P1

What happened?

Two related footguns around the implicit shared dev account:

  1. With no auth configured the CLI signs with the public dev mnemonic and warns on stderr — but with --json the warning is swallowed entirely (withCapturedConsole no-ops console.warn and both stream writes). Verified: pop status --json on a clean HOME emits clean JSON and 0 bytes of stderr.
  2. A typo'd env var name (DOTNS_MNEMONIC_TYPO=...) is silently ignored and the run falls back to the shared account. Verified by warning-count diff between correct and typo'd var names.

So exactly the audience that most needs the warning — scripts and CI running --json — never sees it, and a one-character env typo means transacting from a keypair everyone controls. This is also the top finding of the security review (auth ladder falls back to the public dev mnemonic).

Expected behavior

Either fail closed when nothing but the default resolves (require an explicit --allow-dev-account style opt-in), or at minimum keep the dev-account warning visible in --json mode (stderr is fair game for warnings even with machine-readable stdout).

Contributor guide

Open the contributing guide

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.

Research direction

Start by tracing the CLI's withCapturedConsole behavior in --json mode and the authentication ladder that handles missing or unrecognized environment variables. Reproduce the clean-HOME and typo'd-variable cases described in the issue, then verify that the chosen behavior either blocks implicit default-account use or preserves the warning on stderr without corrupting JSON stdout.

Written by the indexing model from the issue text.

Assessment

Domain
cli, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.