The command line prints a refusal's detail to the terminal unescaped

Open Beginner friendly
#809 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

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

Research direction

Start with service.rs::shown, which already escapes control characters; that is the pattern to lift into a shared helper in the command line's refusal printer. Then find both unescaped call sites: profiles.rs::refuse (used by import-profile and export-profile) and the ladderback mcp call path that prints ladderback: <sentence> on stderr (added in #723). Route both through the helper so C0, DEL and C1 become \u{…}, and add one test per path whose detail contains an escape sequence. Done when every refusal path prints escaped text and those tests pass.

Written by the indexing model from the issue text.

Description

bug priority: low

What happens

When the command line prints a refusal on stderr, the refusal's arguments and detail go to the terminal unescaped. If one holds a control character (an ANSI escape sequence, a carriage return, a bell), the terminal acts on it. A detail can come from a daemon in connect mode, from a profile file, or from a worker's output.

Two places print this way:

  • ladderback mcp call (#723 adds the catalog sentence on stderr, ladderback: <sentence>);
  • profiles.rs::refuse, used by import-profile and export-profile.

service.rs::shown already escapes what it prints, so the command line has the pattern; these two paths don't use it.

Why it matters

A detail with escape sequences can rewrite what the terminal shows (hide a line, move the cursor, change the title), so a person could be misled about what Ladderback refused and why. This isn't a secret leak (I4 masking happens before), but it's untrusted text reaching a terminal.

Proposed

One shared escape in the command line's refusal printer, used by every path that prints a refusal: control characters (C0, DEL, C1) shown as \u{…} or similar, as shown does. A test for each path, with a detail that holds an escape sequence.

Found in the review of #723's PR.

Dominant language
Rust
Stars
0
Forks
0
Avg merge
56m
Merged PRs (30d)
349

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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 nledford/Ladderback

All issues in nledford/Ladderback

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.