Skip to content

fix: debug-info toolchain paths over-ranked as top-value strings #203

Description

@unclesp1d3r

Problem statement

On a Rust binary, the top of the ranked output is dominated by compiler-embedded debug-info source paths, all scored at the maximum:

score=100 tags=['filepath'] sec=__TEXT,__cstring '/Users/.../.cargo/registry/src/index.crates.io-.../patharg-0.4.1/src/lib.rs'
score=100 tags=['filepath'] sec=__TEXT,__cstring '/Users/.../.cargo/registry/.../tempfile-3.27.0/src/error.rs'
... (dozens more identical-shaped cargo registry paths)

These .cargo/registry/.../*.rs paths are build-machine artifacts injected by rustc (panic locations, #[track_caller], etc.). They are filepath-tagged and ranked as the single most valuable strings in the binary -- ahead of URLs, format strings, and real program data. For a triage/analysis tool this is exactly backwards: the highest-signal slots are spent on the lowest-signal strings.

(Note: this is a ranking-quality problem, not a data leak -- the paths are embedded in the binary by the compiler; stringy only surfaces them.)

Format-aware extraction should know that cargo/rustc toolchain paths in a Rust binary are boilerplate, not the interesting strings -- surfacing them at score 100 is the opposite of the tool's thesis.

Proposed solution

Down-weight build-toolchain debug-info paths so they don't crowd out genuine findings. Ideas (not mutually exclusive):

  • Recognize and de-prioritize cargo/rustc registry paths (.cargo/registry/, rustc/.../library/, /rustc/<hash>/) as a known-noise class.
  • More generally, treat repetitive same-shape filepath strings from a single toolchain root as low-value and collapse/down-rank them.
  • Revisit the filepath tag's ranking weight relative to other semantic tags.

Touches: classification (ranking weights, possibly a noise heuristic for toolchain paths).

Alternatives considered

  • Filter them out entirely: too aggressive -- embedded paths can be meaningful in malware/artifacts; down-ranking preserves them without dominating.
  • Leave ranking as-is and rely on --no-tags filepath: puts the burden on the user and also drops legitimately interesting paths.

Area

Semantic classification / ranking

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions