Skip to content

Duplicate Path Only Rule Findings When Scanning Directory #1638

@elchocarrero

Description

@elchocarrero

Describe the bug
When scanning directories, large files in the directory get split into n number of fragments, and each rule is applied per fragment. When a path only rule is ran against a fragment, the rule will match regardless of previous matches for the very same rule. This results in multiple path only rule matches for the same large file.

To Reproduce
Scan directory containing files with a large amount of bytes.
Rulefile with a path only rule.

Expected behavior
Only path rule matches once per file.

Basic Info (please complete the following information):

  • OS: linux/macos
  • Gitleaks Version: 8.21.2

cc @zricethezav

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions