{"id":28615400,"url":"https://github.com/appiumtestdistribution/secure-hulk","last_synced_at":"2025-08-07T18:36:11.401Z","repository":{"id":298052840,"uuid":"979862235","full_name":"AppiumTestDistribution/secure-hulk","owner":"AppiumTestDistribution","description":"Secure-Hulk is a security scanner for Model Context Protocol (MCP) servers and tools. It helps identify potential security vulnerabilities in MCP configurations, such as prompt injection, tool poisoning, cross-origin escalation, data exfiltration, and toxic agent flows.","archived":false,"fork":false,"pushed_at":"2025-06-09T06:08:25.000Z","size":778,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-05T15:56:23.886Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AppiumTestDistribution.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-08T07:24:57.000Z","updated_at":"2025-06-28T07:31:26.000Z","dependencies_parsed_at":"2025-06-09T06:41:21.459Z","dependency_job_id":null,"html_url":"https://github.com/AppiumTestDistribution/secure-hulk","commit_stats":null,"previous_names":["appiumtestdistribution/secure-hulk"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AppiumTestDistribution/secure-hulk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AppiumTestDistribution%2Fsecure-hulk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AppiumTestDistribution%2Fsecure-hulk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AppiumTestDistribution%2Fsecure-hulk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AppiumTestDistribution%2Fsecure-hulk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AppiumTestDistribution","download_url":"https://codeload.github.com/AppiumTestDistribution/secure-hulk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AppiumTestDistribution%2Fsecure-hulk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269307593,"owners_count":24395446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-07T02:00:09.698Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-12T02:08:23.101Z","updated_at":"2025-08-07T18:36:11.352Z","avatar_url":"https://github.com/AppiumTestDistribution.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"src/assets/SecureHulkLogo.png\" alt=\"Secure-Hulk Logo\" width=\"400\"/\u003e\n  \n  # Secure-Hulk\n  \n  Security scanner for Model Context Protocol servers and tools.\n\u003c/div\u003e\n\n## Overview\n\nSecure-Hulk is a security scanner for Model Context Protocol (MCP) servers and tools. It helps identify potential security vulnerabilities in MCP configurations, such as prompt injection, tool poisoning, cross-origin escalation, data exfiltration, and toxic agent flows.\n\n## Features\n\n- Scan MCP configurations for security vulnerabilities\n- Detect prompt injection attempts\n- Identify tool poisoning vulnerabilities\n- Check for cross-origin escalation risks\n- Monitor for data exfiltration attempts\n- **Detect toxic agent flows** - Multi-step attacks that manipulate agents into unintended actions\n- **Privilege escalation detection** - Identify attempts to escalate from public to private access\n- **Cross-resource attack detection** - Monitor suspicious access patterns across multiple resources\n- **Indirect prompt injection detection** - Catch attacks through external content processing\n- Generate HTML reports of scan results\n- Whitelist approved entities\n\n## Installation\n\n```bash\nnpm install\nnpm run build\n```\n\n## Usage\n\n### Scanning MCP Configurations\n\n```bash\n# Scan well-known MCP configuration paths\nnpm i secure-hulk\n\n# Scan specific configuration files\nsecure-hulk scan /path/to/config.json\n\n# Generate HTML report\nsecure-hulk scan --html report.html /path/to/config.json\n\n# Enable verbose output\nsecure-hulk scan -v /path/to/config.json\n\n# Output results in JSON format\nsecure-hulk scan -j /path/to/config.json\n```\n\n### Using OpenAI Moderation API for Harmful Content Detection\n\nSecure-Hulk now supports using OpenAI's Moderation API to detect harmful content in entity descriptions. This provides a more robust detection mechanism for identifying potentially harmful, unsafe, or unethical content.\n\nTo use the OpenAI Moderation API:\n\n```bash\nsecure-hulk scan --use-openai-moderation --openai-api-key YOUR_API_KEY /path/to/config.json\n```\n\nOptions:\n\n- `--use-openai-moderation`: Enable OpenAI Moderation API for prompt injection detection\n- `--openai-api-key \u003ckey\u003e`: Your OpenAI API key\n- `--openai-moderation-model \u003cmodel\u003e`: OpenAI Moderation model to use (default: 'omni-moderation-latest')\n\nThe OpenAI Moderation API provides several advantages:\n\n1. **More accurate detection**: The API uses advanced AI models to detect harmful content, which can catch subtle harmful content that pattern matching might miss.\n2. **Categorized results**: The API provides detailed categories for flagged content (hate, harassment, self-harm, sexual content, violence, etc.), helping you understand the specific type of harmful content detected.\n3. **Confidence scores**: Each category includes a confidence score, allowing you to set appropriate thresholds for your use case.\n4. **Regular updates**: The API is regularly updated to detect new types of harmful content as OpenAI's policies evolve.\n\nThe API can detect content in these categories:\n\n- Hate speech\n- Harassment\n- Self-harm\n- Sexual content\n- Violence\n- Illegal activities\n- Deception\n\nIf the OpenAI Moderation API check fails for any reason, Secure-Hulk will automatically fall back to pattern-based detection for prompt injection vulnerabilities.\n\n### Using Hugging Face Safety Models for Content Detection\n\nSecure-Hulk now supports Hugging Face safety models for advanced AI-powered content moderation. This provides additional options beyond OpenAI's Moderation API, including open-source models and specialized toxicity detection.\n\nTo use Hugging Face safety models:\n\n```bash\nsecure-hulk scan --use-huggingface-guardrails --huggingface-api-token YOUR_HF_TOKEN /path/to/config.json\n```\n\nOptions:\n\n- `--use-huggingface-guardrails`: Enable Hugging Face safety models for content detection\n- `--huggingface-api-token \u003ctoken\u003e`: Your Hugging Face API token\n- `--huggingface-model \u003cmodel\u003e`: Specific model to use (default: 'unitary/toxic-bert')\n- `--huggingface-threshold \u003cthreshold\u003e`: Confidence threshold for flagging content (default: 0.5)\n- `--huggingface-preset \u003cpreset\u003e`: Use preset configurations: 'toxicity', 'hate-speech', 'multilingual', 'strict'\n- `--huggingface-timeout \u003cmilliseconds\u003e`: Timeout for API calls (default: 10000)\n\nAvailable models include:\n\n- **unitary/toxic-bert**: General toxicity detection (recommended default)\n- **s-nlp/roberta_toxicity_classifier**: High-sensitivity toxicity detection\n- **unitary/unbiased-toxic-roberta**: Bias-reduced toxicity detection\n\nPreset configurations:\n\n- `toxicity`: General purpose toxicity detection\n- `strict`: High sensitivity for maximum safety\n\nExample with multiple guardrails:\n\n```bash\nsecure-hulk scan \\\n  --use-openai-moderation --openai-api-key YOUR_OPENAI_KEY \\\n  --use-huggingface-guardrails --huggingface-preset toxicity --huggingface-api-token YOUR_HF_TOKEN \\\n  --use-nemo-guardrails --nemo-guardrails-config-path ./guardrails-config \\\n  /path/to/config.json\n```\n\nThe Hugging Face integration provides several advantages:\n\n1. **Model diversity**: Choose from multiple specialized safety models\n2. **Open-source options**: Use community-developed models\n3. **Customizable thresholds**: Fine-tune sensitivity for your use case\n4. **Specialized detection**: Models focused on specific types of harmful content\n5. **Cost flexibility**: Various pricing options including free tiers\n\nIf the Hugging Face API check fails for any reason, Secure-Hulk will log the error and continue with other security checks.\n\n### Inspecting MCP Configurations\n\n```bash\nsecure-hulk inspect /path/to/config.json\n```\n\n### Managing the Whitelist\n\n```bash\n# Add an entity to the whitelist\nsecure-hulk whitelist tool \"Calculator\" abc123\n\n# Print the whitelist\nsecure-hulk whitelist\n\n# Reset the whitelist\nsecure-hulk whitelist --reset\n```\n\n## Configuration\n\n### Scan Options\n\n- `--json, -j`: Output results in JSON format\n- `--verbose, -v`: Enable verbose output\n- `--html \u003cpath\u003e`: Generate HTML report and save to specified path\n- `--storage-file \u003cpath\u003e`: Path to store scan results and whitelist information\n- `--server-timeout \u003cseconds\u003e`: Seconds to wait before timing out server connections\n- `--checks-per-server \u003cnumber\u003e`: Number of times to check each server\n- `--suppress-mcpserver-io \u003cboolean\u003e`: Suppress stdout/stderr from MCP servers\n\n### Whitelist Options\n\n- `--storage-file \u003cpath\u003e`: Path to store scan results and whitelist information\n- `--reset`: Reset the entire whitelist\n- `--local-only`: Only update local whitelist, don't contribute to global whitelist\n\n## Sponsors\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch3\u003eProudly sponsored by LambdaTest\u003c/h3\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"src/assets/White_512px.png\"\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"src/assets/Black_512px.png\"\u003e\n    \u003cimg src=\"src/assets/Black_512px.png\" alt=\"Lambdates Logo\" width=\"150\"/\u003e\n  \u003c/picture\u003e\n\u003c/div\u003e\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappiumtestdistribution%2Fsecure-hulk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappiumtestdistribution%2Fsecure-hulk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappiumtestdistribution%2Fsecure-hulk/lists"}