Skip to content

Registry scans can overwrite their input or comparison report #756

Description

@YMuskrat

On main at b6f0304, the registry scan branch returns before the same-file output guard added in #729. As a result, a successful scan can replace its own input with the generated report.

Reproduction (no LLM required):

printf '{"servers":[]}\n' > registry.json
skillspector scan registry.json --mcp-registry --format json --output registry.json

Expected: reject the output path before scanning and preserve the input bytes.
Actual: exit 0 and replace registry.json with the scan report.

The same issue affects an existing comparison report passed with --mcp-registry-compare previous-report.json --output previous-report.json. Symlink and hardlink aliases can also refer to the same file.

I can reuse the existing destination check for both registry inputs before invoking the scanner, with regression tests for path aliases and separate-output success.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions