Skip to content

False positive: MALWAR-PERSIST-002 triggers on benign documentation text #2

@Ap6pack

Description

@Ap6pack

Problem

Rule MALWAR-PERSIST-002 (file system modification detection) triggers on Anthropic's official skill-creator skill, which is benign. The rule flags lines 91-92 which contain documentation about file management best practices — not actual file system modification commands.

Scan output:

anthropic_skill_creator.md → MALICIOUS (risk: 100)
  MALWAR-PERSIST-002 at L91: "If files are large (>10k words), include grep search patterns in SKILL.md"
  MALWAR-PERSIST-002 at L92: "Information should live in either SKILL.md or references files, not both"

Expected Behavior

This skill should be rated CLEAN. The rule should distinguish between actual commands that modify files and documentation text that mentions files.

How to Fix

  1. Look at the rule definition for MALWAR-PERSIST-002 in src/malwar/rules/
  2. The regex pattern is too broad — it matches the word "file" in general documentation context
  3. Tighten the pattern to require actual command syntax (e.g., mkdir, mv, cp, write_to, shell redirects) rather than prose mentioning files
  4. Add tests/fixtures/skills/real/benign/anthropic_skill_creator.md as a regression test

Test File

The skill that triggers this false positive is at: tests/fixtures/skills/real/benign/anthropic_skill_creator.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions