Raw scan report

Huggingface Hub — the complete, unedited output of the deterministic mcptrustchecker engine v1.9.0, scanned . Every finding, capability tag and score component below is exactly what the engine produced — no AI, no post-processing.

← Back to the scan page
{
  "tool": {
    "name": "mcptrustchecker",
    "version": "1.9.0",
    "methodologyVersion": "mcptrustchecker-1.9"
  },
  "target": {
    "id": "huggingface-hub",
    "source": {
      "kind": "package",
      "origin": "huggingface-hub"
    },
    "server": {
      "name": "huggingface-hub"
    }
  },
  "grade": "A",
  "score": {
    "score": 93,
    "threatScore": 100,
    "grade": "A",
    "band": "A",
    "categorySubtotals": {
      "injection": 0,
      "exfiltration": 0,
      "permissions": 0,
      "supply-chain": 0,
      "network": 0,
      "hygiene": 0
    },
    "vector": [
      {
        "kind": "client",
        "term": "capability-exposure",
        "level": "high",
        "label": "capability blast radius (high) — client exposure if the model is manipulated",
        "appliedPenalty": 6
      },
      {
        "kind": "client",
        "term": "verification-discount",
        "level": "repo",
        "label": "publisher verification (public source) — no provenance, but the source is public and inspectable",
        "appliedPenalty": 1
      },
      {
        "kind": "client",
        "term": "coverage-honesty",
        "level": "source",
        "label": "inspection depth (source) — how much of the target the scan could see",
        "appliedPenalty": 0
      }
    ],
    "gatesFired": [],
    "methodologyVersion": "mcptrustchecker-1.9"
  },
  "capability": {
    "level": "high",
    "reasons": [
      "reads sensitive or local data",
      "has a read → egress path (a data-exfiltration surface)",
      "can execute shell commands or code"
    ],
    "tags": [
      "sensitive-source",
      "code-exec"
    ]
  },
  "coverage": {
    "level": "source",
    "inputs": {
      "toolSurface": false,
      "implementationSource": true,
      "packageMetadata": true,
      "liveTransport": false
    },
    "caveats": [
      "No tools were enumerated, so prompt-injection, capability and toxic-flow analysis had no tool surface to inspect. To grade a package’s real runtime tools, scan the running server: --command \"npx -y <package>\"."
    ]
  },
  "findings": [
    {
      "ruleId": "MTC-SRC-006",
      "title": "Reads a sensitive credential path or dumps the environment (src/huggingface_hub/cli/jobs.py)",
      "category": "exfiltration",
      "severity": "high",
      "confidence": "strong",
      "description": "In the server's implementation (`src/huggingface_hub/cli/jobs.py:854`): Reading private keys / cloud credentials, or serializing the whole environment, is a sensitive-data source that becomes exfiltration when combined with any egress. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.",
      "remediation": "Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.",
      "location": {
        "kind": "server",
        "name": "src/huggingface_hub/cli/jobs.py"
      },
      "evidence": "ssh <job_id> -i ~/.ssh/id_ed25519\", ], ) def jobs_ssh( job_id: JobIdArg, identity_file: SshIdentityFileOpt",
      "owasp": "LLM02:2025 Sensitive Information Disclosure",
      "data": {
        "rule": "MTC-SRC-006",
        "file": "src/huggingface_hub/cli/jobs.py",
        "line": 854,
        "nonRuntime": false
      }
    },
    {
      "ruleId": "MTC-SRC-006",
      "title": "Reads a sensitive credential path or dumps the environment (src/huggingface_hub/cli/spaces.py)",
      "category": "exfiltration",
      "severity": "high",
      "confidence": "strong",
      "description": "In the server's implementation (`src/huggingface_hub/cli/spaces.py:400`): Reading private keys / cloud credentials, or serializing the whole environment, is a sensitive-data source that becomes exfiltration when combined with any egress. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.",
      "remediation": "Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.",
      "location": {
        "kind": "server",
        "name": "src/huggingface_hub/cli/spaces.py"
      },
      "evidence": "name/my-space -i ~/.ssh/id_ed25519\", \"hf spaces ssh username/my-space --auto\", ], ) def spaces_ssh( spac",
      "owasp": "LLM02:2025 Sensitive Information Disclosure",
      "data": {
        "rule": "MTC-SRC-006",
        "file": "src/huggingface_hub/cli/spaces.py",
        "line": 400,
        "nonRuntime": false
      }
    },
    {
      "ruleId": "MTC-SRC-002",
      "title": "Shell/command execution in server code (src/huggingface_hub/_dataset_viewer.py)",
      "category": "permissions",
      "severity": "high",
      "confidence": "strong",
      "description": "In the server's implementation (`src/huggingface_hub/_dataset_viewer.py:145`): Spawning a shell/process is command-execution capability; with unsanitized tool input it is command injection / RCE. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.",
      "remediation": "Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.",
      "location": {
        "kind": "server",
        "name": "src/huggingface_hub/_dataset_viewer.py"
      },
      "evidence": "binary result = subprocess.run( [self.binary_path, \"-json\"], input=full_query,",
      "owasp": "LLM05:2025 Improper Output Handling",
      "data": {
        "rule": "MTC-SRC-002",
        "file": "src/huggingface_hub/_dataset_viewer.py",
        "line": 145,
        "nonRuntime": false
      }
    },
    {
      "ruleId": "MTC-SRC-002",
      "title": "Shell/command execution in server code (src/huggingface_hub/_sandbox.py)",
      "category": "permissions",
      "severity": "high",
      "confidence": "strong",
      "description": "In the server's implementation (`src/huggingface_hub/_sandbox.py:301`): Spawning a shell/process is command-execution capability; with unsanitized tool input it is command injection / RCE. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.",
      "remediation": "Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.",
      "location": {
        "kind": "server",
        "name": "src/huggingface_hub/_sandbox.py"
      },
      "evidence": "raise ValueError(\"shell=True requires `cmd` to be a shell command string, not a list.\") if shell is False and",
      "owasp": "LLM05:2025 Improper Output Handling",
      "data": {
        "rule": "MTC-SRC-002",
        "file": "src/huggingface_hub/_sandbox.py",
        "line": 301,
        "nonRuntime": false
      }
    },
    {
      "ruleId": "MTC-SRC-002",
      "title": "Shell/command execution in server code (src/huggingface_hub/cli/_cli_utils.py)",
      "category": "permissions",
      "severity": "high",
      "confidence": "strong",
      "description": "In the server's implementation (`src/huggingface_hub/cli/_cli_utils.py:931`): Spawning a shell/process is command-execution capability; with unsanitized tool input it is command injection / RCE. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.",
      "remediation": "Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.",
      "location": {
        "kind": "server",
        "name": "src/huggingface_hub/cli/_cli_utils.py"
      },
      "evidence": "n(cmd)}`\") result = subprocess.run(cmd) raise click.exceptions.Exit(code=result.returncode) ### PyPI VERSION C",
      "owasp": "LLM05:2025 Improper Output Handling",
      "data": {
        "rule": "MTC-SRC-002",
        "file": "src/huggingface_hub/cli/_cli_utils.py",
        "line": 931,
        "nonRuntime": false
      }
    },
    {
      "ruleId": "MTC-SRC-002",
      "title": "Shell/command execution in server code (src/huggingface_hub/cli/extensions.py)",
      "category": "permissions",
      "severity": "high",
      "confidence": "strong",
      "description": "In the server's implementation (`src/huggingface_hub/cli/extensions.py:525`): Spawning a shell/process is command-execution capability; with unsanitized tool input it is command injection / RCE. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.",
      "remediation": "Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.",
      "location": {
        "kind": "server",
        "name": "src/huggingface_hub/cli/extensions.py"
      },
      "evidence": "if uv_path: subprocess.run([uv_path, \"venv\", str(venv_dir)], check=True) else: venv.EnvB",
      "owasp": "LLM05:2025 Improper Output Handling",
      "data": {
        "rule": "MTC-SRC-002",
        "file": "src/huggingface_hub/cli/extensions.py",
        "line": 525,
        "nonRuntime": false
      }
    },
    {
      "ruleId": "MTC-SRC-002",
      "title": "Shell/command execution in server code (src/huggingface_hub/cli/lfs.py)",
      "category": "permissions",
      "severity": "high",
      "confidence": "strong",
      "description": "In the server's implementation (`src/huggingface_hub/cli/lfs.py:54`): Spawning a shell/process is command-execution capability; with unsanitized tool input it is command injection / RCE. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.",
      "remediation": "Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.",
      "location": {
        "kind": "server",
        "name": "src/huggingface_hub/cli/lfs.py"
      },
      "evidence": "a valid git repo.\") subprocess.run( \"git config lfs.customtransfer.multipart.path hf\".split(), check",
      "owasp": "LLM05:2025 Improper Output Handling",
      "data": {
        "rule": "MTC-SRC-002",
        "file": "src/huggingface_hub/cli/lfs.py",
        "line": 54,
        "nonRuntime": false
      }
    },
    {
      "ruleId": "MTC-SRC-002",
      "title": "Shell/command execution in server code (src/huggingface_hub/cli/spaces.py)",
      "category": "permissions",
      "severity": "high",
      "confidence": "strong",
      "description": "In the server's implementation (`src/huggingface_hub/cli/spaces.py:871`): Spawning a shell/process is command-execution capability; with unsanitized tool input it is command injection / RCE. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.",
      "remediation": "Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.",
      "location": {
        "kind": "server",
        "name": "src/huggingface_hub/cli/spaces.py"
      },
      "evidence": ", local_path] res = subprocess.run(command, start_new_session=True) return res.returncode @volumes_cli.command",
      "owasp": "LLM05:2025 Improper Output Handling",
      "data": {
        "rule": "MTC-SRC-002",
        "file": "src/huggingface_hub/cli/spaces.py",
        "line": 871,
        "nonRuntime": false
      }
    },
    {
      "ruleId": "MTC-SRC-002",
      "title": "Shell/command execution in server code (src/huggingface_hub/utils/_subprocess.py)",
      "category": "permissions",
      "severity": "high",
      "confidence": "strong",
      "description": "In the server's implementation (`src/huggingface_hub/utils/_subprocess.py:85`): Spawning a shell/process is command-execution capability; with unsanitized tool input it is command injection / RCE. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.",
      "remediation": "Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.",
      "location": {
        "kind": "server",
        "name": "src/huggingface_hub/utils/_subprocess.py"
      },
      "evidence": "str(folder) return subprocess.run( command, capture_output=True, check=check, encod",
      "owasp": "LLM05:2025 Improper Output Handling",
      "data": {
        "rule": "MTC-SRC-002",
        "file": "src/huggingface_hub/utils/_subprocess.py",
        "line": 85,
        "nonRuntime": false
      }
    },
    {
      "ruleId": "MTC-SRC-001",
      "title": "Dynamic code execution in packaging/dev tooling (tests/test_utils_typing.py)",
      "category": "permissions",
      "severity": "low",
      "confidence": "heuristic",
      "description": "In a packaging/dev/install script (shipped, but not the server runtime) (`tests/test_utils_typing.py:98`): Evaluating strings as code is the most direct RCE primitive; if any tool input reaches it, the server executes attacker-chosen code. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.",
      "remediation": "Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.",
      "location": {
        "kind": "server",
        "name": "tests/test_utils_typing.py"
      },
      "evidence": "is_simple_optional_type(eval(type_)) is is_optional @pytest.mark.parametrize( \"optional_type, inner_type\", [",
      "owasp": "LLM05:2025 Improper Output Handling",
      "data": {
        "rule": "MTC-SRC-001",
        "file": "tests/test_utils_typing.py",
        "line": 98,
        "nonRuntime": true
      }
    },
    {
      "ruleId": "MTC-SRC-002",
      "title": "Shell/command execution in packaging/dev tooling (tests/test_hf_api.py)",
      "category": "permissions",
      "severity": "low",
      "confidence": "heuristic",
      "description": "In a packaging/dev/install script (shipped, but not the server runtime) (`tests/test_hf_api.py:2828`): Spawning a shell/process is command-execution capability; with unsanitized tool input it is command injection / RCE. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.",
      "remediation": "Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.",
      "location": {
        "kind": "server",
        "name": "tests/test_hf_api.py"
      },
      "evidence": "ser:{TOKEN}@\") subprocess.run( [\"git\", \"clone\", repo_url_auth, str(tmp_path)], check=Tr",
      "owasp": "LLM05:2025 Improper Output Handling",
      "data": {
        "rule": "MTC-SRC-002",
        "file": "tests/test_hf_api.py",
        "line": 2828,
        "nonRuntime": true
      }
    },
    {
      "ruleId": "MTC-SRC-002",
      "title": "Shell/command execution in packaging/dev tooling (tests/test_sandbox.py)",
      "category": "permissions",
      "severity": "low",
      "confidence": "heuristic",
      "description": "In a packaging/dev/install script (shipped, but not the server runtime) (`tests/test_sandbox.py:237`): Spawning a shell/process is command-execution capability; with unsanitized tool input it is command injection / RCE. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.",
      "remediation": "Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.",
      "location": {
        "kind": "server",
        "name": "tests/test_sandbox.py"
      },
      "evidence": "sandbox.run(\"echo hi\", shell=True) assert _FakeServer.last_exec == {\"cmd\": \"echo hi\", \"shell\": True} sa",
      "owasp": "LLM05:2025 Improper Output Handling",
      "data": {
        "rule": "MTC-SRC-002",
        "file": "tests/test_sandbox.py",
        "line": 237,
        "nonRuntime": true
      }
    },
    {
      "ruleId": "MTC-SRC-002",
      "title": "Shell/command execution in packaging/dev tooling (tests/test_utils_sha.py)",
      "category": "permissions",
      "severity": "low",
      "confidence": "heuristic",
      "description": "In a packaging/dev/install script (shipped, but not the server runtime) (`tests/test_utils_sha.py:39`): Spawning a shell/process is command-execution capability; with unsanitized tool input it is command injection / RCE. This is read from the code itself — not from the tool description — so a poisoned server cannot hide it behind honest-looking metadata.",
      "remediation": "Review this call path: confirm it never receives unsanitized tool input, constrain it, or remove it. Treat a server whose code reaches these sinks as high-capability regardless of what its tools claim.",
      "location": {
        "kind": "server",
        "name": "tests/test_utils_sha.py"
      },
      "evidence": "World!\") output = subprocess.run(f\"git hash-object -t blob {path}\", shell=True, capture_output=True, text=True)",
      "owasp": "LLM05:2025 Improper Output Handling",
      "data": {
        "rule": "MTC-SRC-002",
        "file": "tests/test_utils_sha.py",
        "line": 39,
        "nonRuntime": true
      }
    }
  ],
  "toxicFlows": [],
  "capabilities": [],
  "surfaceDigest": "d13cf71eb05ff05aa7f33fedab54510812b54a6efe6ede4c9e41f6f0602744dc",
  "stats": {
    "tools": 0,
    "prompts": 0,
    "resources": 0,
    "findingsBySeverity": {
      "critical": 0,
      "high": 9,
      "medium": 0,
      "low": 4,
      "info": 0
    }
  }
}