Skip to content

Files over 2 MB are skipped silently, so padding a payload evades the scanner without a word #4

Description

@royalpinto007

In scanSkill:

if (statSync(f).size > MAX_BYTES) continue;

The file is dropped and nothing records that it happened. It is not in the findings, not in the files count, and not in any report output. The user sees a clean scan.

For a security scanner this is the worst possible failure mode: padding a malicious script past 2 MB with a comment block is a two-line evasion, and the tool actively reassures the user afterwards.

The same applies to the catch { continue; } on the read: an unreadable file is indistinguishable from an absent one.

Suggested fix

Track skipped files with a reason and surface them. At minimum in the human report and the JSON output; arguably a skipped file should also stop the run from being reported as clean.

Acceptance

  • Scanning a directory containing a 3 MB text file reports that the file was not scanned, and why
  • The same for a file that cannot be read
  • --json output includes the skipped list
  • A scan with skipped files is not presented as an all-clear

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions