Skip to content

Some filters drop or misrepresent requested data (find, ls -R, env, cargo label) #2271

Closed

Description

@sysrow

While using RTK's filtered output, a few commands drop or misrepresent the data that was actually requested. None of these corrupt data, but each can hide requested results or mislead a reader.

1. find truncates a directory mid-listing

The --max budget is counted across directories, so the last shown directory can be cut after only some of its files while still rendered as a normal dir/ files line. The listing then looks complete and the trailing +N more is attributed to other directories. Someone checking whether a file exists in that directory is misled into thinking the directory was fully listed.

2. ls -R drops directory headers

ls -R prints one path: section per directory. The compactor flattens every section into a single list and drops the headers, so files can no longer be mapped to their directory (many distinct mod.rs entries become indistinguishable). The output can even be larger than the raw listing.

3. env silently drops secret-bearing variables

A sensitive variable that does not match a known category (cloud/tool/language) falls through every bucket and is omitted entirely, so rtk env implies it is unset — even when the user wants to confirm it is set. (Categorized secrets such as AWS_SECRET_ACCESS_KEY are already shown masked; the gap is the uncategorized ones.)

4. cargo check is labeled cargo build

CargoBuildHandler is shared by build and check, but the summary string is hardcoded to cargo build, so rtk cargo check reports cargo build (N crates compiled).

A PR with atomic commits (one fix per commit) follows.

Activity

  1. added
    bug
    help wanted
    on Jun 4, 2026
  2. pszymkowiak commented on Jun 4, 2026

    @pszymkowiak
    Collaborator

    wshm · Automated triage by AI

    🔍 Automated Triage

    🐛 Category bug
    🟠 Priority high
    🎯 Confidence 97%

    Summary

    Multiple filter handlers silently drop or misrepresent output (find truncation, ls -R header loss, env variable omission, cargo check mislabeled); fix PR #2272 already open.


    Triaged automatically by wshm · This is an automated analysis, not a human review.

  3. laurac8r commented on Jun 26, 2026

    @laurac8r

    Re item # 3 (env dropping uncategorized secret-bearing vars): worth pairing the fix with value-based masking. Masking today keys off the variable name (a denylist), and the value is never inspected — so once an uncategorized var like DATABASE_URL=postgres://user:pw@… is surfaced instead of dropped, it'd be shown in full. Un-dropping without value inspection turns a silent drop into a silent leak. SECURITY.md's "use allowlists, not denylists" points the same way. (src/cmds/system/env_cmd.rs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:clibughelp wantedpriority:high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions