mcpsec 2.7.0__tar.gz → 2.7.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mcpsec-2.7.0 → mcpsec-2.7.2}/.gitignore +2 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/CHANGELOG.md +35 -1
- {mcpsec-2.7.0 → mcpsec-2.7.2}/PKG-INFO +88 -105
- {mcpsec-2.7.0 → mcpsec-2.7.2}/README.md +87 -104
- mcpsec-2.7.2/mcpsec/__init__.py +11 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/ai/ai_payload_generator.py +10 -6
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/ai/ai_taint_analyzer.py +12 -8
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/ai/ai_validator.py +10 -6
- mcpsec-2.7.2/mcpsec/ai/finding_classifier.py +352 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/ai/llm_client.py +11 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/cli.py +113 -52
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/client/__init__.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/client/mcp_client.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/config.py +7 -3
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/discovery.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/engine.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/exploit/__init__.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/exploit/connection.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/exploit/evidence.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/exploit/formatters.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/exploit/mcp_repl.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/exploit/payload_engine.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/exploit/playbooks/__init__.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/exploit/playbooks/command_injection.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/exploit/playbooks/generic.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/exploit/playbooks/path_traversal.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/exploit/playbooks/prompt_injection.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/exploit/playbooks/sandbox_escape.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/exploit/playbooks/sqli.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/exploit/playbooks/ssrf.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/exploit/session.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/exploit/state_tracker.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/chain/__init__.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/chain/chain_analyzer.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/chain/chain_builder.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/chain/chain_engine.py +7 -2
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/chain/chain_reporter.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/chain/injection_points.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/chain/state_extractor.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/chain/state_manager.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/evolve/__init__.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/evolve/corpus.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/evolve/engine.py +10 -5
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/evolve/feedback.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/evolve/mcp_mutators.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/evolve/mutators.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/evolve/scheduler.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/fuzz_engine.py +10 -6
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/generators/__init__.py +2 -2
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/generators/base.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/generators/boundary_testing.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/generators/concurrency_attacks.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/generators/deserialization.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/generators/encoding_attacks.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/generators/header_mutations.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/generators/id_confusion.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/generators/injection_payloads.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/generators/integer_boundaries.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/generators/json_edge_cases.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/generators/malformed_json.py +1 -0
- mcpsec-2.7.0/mcpsec/fuzzer/generators/memory_exhaustion_v2.py → mcpsec-2.7.2/mcpsec/fuzzer/generators/memory_exhaustion.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/generators/method_mutations.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/generators/param_mutations.py +1 -0
- mcpsec-2.7.2/mcpsec/fuzzer/generators/protocol_state.py +441 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/generators/protocol_violation.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/generators/regex_dos.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/generators/resource_exhaustion.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/generators/session_attacks.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/generators/timing_attacks.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/generators/type_confusion.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/generators/unicode_attacks.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/transport/http_fuzzer.py +8 -3
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/fuzzer/transport/stdio_fuzzer.py +12 -9
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/models.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/reporters/__init__.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/reporters/json_report.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/reporters/sarif_report.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rogue/__init__.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rogue/payloads.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rogue/server.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/scanners/__init__.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/scanners/annotation_integrity.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/scanners/auth_audit.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/scanners/base.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/scanners/capability_escalation.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/scanners/code_execution.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/scanners/command_injection.py +3 -3
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/scanners/description_injection.py +7 -3
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/scanners/description_prompt_injection.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/scanners/deserialization.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/scanners/idor.py +7 -3
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/scanners/info_leak.py +9 -5
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/scanners/path_traversal.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/scanners/prompt_injection.py +9 -6
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/scanners/rag_poisoning.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/scanners/resource_ssrf.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/scanners/response_classifier.py +11 -9
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/scanners/secrets_exposure.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/scanners/sql_rce.py +9 -4
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/scanners/ssrf.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/scanners/template_injection.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/scanners/toolchain_analyzer.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/sql_scanner/__init__.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/sql_scanner/confirmer.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/sql_scanner/detector.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/sql_scanner/fingerprint.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/sql_scanner/payloads.py +1 -0
- mcpsec-2.7.2/mcpsec/static/analysis/__init__.py +7 -0
- mcpsec-2.7.2/mcpsec/static/analysis/reachability.py +243 -0
- mcpsec-2.7.2/mcpsec/static/analysis/sink_scanner.py +209 -0
- mcpsec-2.7.2/mcpsec/static/audit_engine.py +332 -0
- mcpsec-2.7.2/mcpsec/static/framework/__init__.py +6 -0
- mcpsec-2.7.2/mcpsec/static/framework/detector.py +271 -0
- mcpsec-2.7.2/mcpsec/static/patterns/__init__.py +2 -0
- mcpsec-2.7.2/mcpsec/static/patterns/base.py +193 -0
- mcpsec-2.7.2/mcpsec/static/patterns/generator.py +108 -0
- mcpsec-2.7.2/mcpsec/static/patterns/registry.py +184 -0
- mcpsec-2.7.2/mcpsec/static/patterns/sanitizers/__init__.py +6 -0
- mcpsec-2.7.2/mcpsec/static/patterns/sanitizers/sanitizers.py +858 -0
- mcpsec-2.7.2/mcpsec/static/patterns/sinks/__init__.py +12 -0
- mcpsec-2.7.2/mcpsec/static/patterns/sinks/code_execution.py +3267 -0
- mcpsec-2.7.2/mcpsec/static/patterns/sinks/command_injection.py +5213 -0
- mcpsec-2.7.2/mcpsec/static/patterns/sinks/crypto.py +646 -0
- mcpsec-2.7.2/mcpsec/static/patterns/sinks/deserialization.py +592 -0
- mcpsec-2.7.2/mcpsec/static/patterns/sinks/misc.py +4583 -0
- mcpsec-2.7.2/mcpsec/static/patterns/sinks/path_traversal.py +8080 -0
- mcpsec-2.7.2/mcpsec/static/patterns/sinks/sql_injection.py +5900 -0
- mcpsec-2.7.2/mcpsec/static/patterns/sinks/ssrf.py +6426 -0
- mcpsec-2.7.2/mcpsec/static/patterns/sinks/xxe.py +398 -0
- mcpsec-2.7.2/mcpsec/static/patterns/sources/__init__.py +6 -0
- mcpsec-2.7.2/mcpsec/static/patterns/sources/mcp_frameworks.py +388 -0
- mcpsec-2.7.2/mcpsec/static/semgrep_engine.py +327 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/static/source_fetcher.py +1 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/ui.py +94 -57
- {mcpsec-2.7.0 → mcpsec-2.7.2}/pyproject.toml +1 -1
- mcpsec-2.7.0/mcpsec/__init__.py +0 -3
- mcpsec-2.7.0/mcpsec/fuzzer/generators/protocol_state.py +0 -245
- mcpsec-2.7.0/mcpsec/fuzzer/generators/protocol_state_machine.py +0 -297
- mcpsec-2.7.0/mcpsec/sql_scanner/exploiter.py +0 -8
- mcpsec-2.7.0/mcpsec/sql_scanner/rce.py +0 -8
- mcpsec-2.7.0/mcpsec/static/audit_engine.py +0 -242
- mcpsec-2.7.0/mcpsec/static/py_analyzer.py +0 -177
- mcpsec-2.7.0/mcpsec/static/semgrep_engine.py +0 -99
- mcpsec-2.7.0/mcpsec/static/taint_analyzer.py +0 -22
- mcpsec-2.7.0/mcpsec_corpus/24482bed0370e24d.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/24482bed0370e24d.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/245255d1b0fdd47c.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/245255d1b0fdd47c.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/2e7a375598c585bf.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/2e7a375598c585bf.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/4058ea2baa0558ad.bin +0 -0
- mcpsec-2.7.0/mcpsec_corpus/4058ea2baa0558ad.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/417c8b6cedd76a8a.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/417c8b6cedd76a8a.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/4bc854cb67a58cca.bin +0 -0
- mcpsec-2.7.0/mcpsec_corpus/4bc854cb67a58cca.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/512f3f5f43006b05.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/512f3f5f43006b05.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/70ab5f4ccee45fa8.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/70ab5f4ccee45fa8.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/71d2c5112543060c.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/71d2c5112543060c.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/75216854d4fdbee6.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/75216854d4fdbee6.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/8e6bb8b15eaabe05.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/8e6bb8b15eaabe05.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/8ebaf70890700002.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/8ebaf70890700002.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/94bfe6f3e6b7f5b6.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/94bfe6f3e6b7f5b6.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/a649c02cc49a8bb2.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/a649c02cc49a8bb2.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/b1181fc12b56b288.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/b1181fc12b56b288.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/b3263b9d5b258113.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/b3263b9d5b258113.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/c06663fda69f3c4e.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/c06663fda69f3c4e.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/c4148da8ae82dbaa.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/c4148da8ae82dbaa.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/c935ce06ff81e99e.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/c935ce06ff81e99e.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/cb5390c39c064487.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/cb5390c39c064487.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/crash_test.py +0 -18
- mcpsec-2.7.0/mcpsec_corpus/crash_test2.py +0 -19
- mcpsec-2.7.0/mcpsec_corpus/d39c65d280b38354.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/d39c65d280b38354.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/d9f906dd2c6b612e.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/d9f906dd2c6b612e.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/dfa8b86a3e01c37c.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/dfa8b86a3e01c37c.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/f31e9f689d83dc00.bin +0 -0
- mcpsec-2.7.0/mcpsec_corpus/f31e9f689d83dc00.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/fetch_corpus/2e7a375598c585bf.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/fetch_corpus/2e7a375598c585bf.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/fetch_corpus/4d2c228a37d2a1ff.bin +0 -0
- mcpsec-2.7.0/mcpsec_corpus/fetch_corpus/4d2c228a37d2a1ff.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/fetch_corpus/512f3f5f43006b05.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/fetch_corpus/512f3f5f43006b05.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/fetch_corpus/7a300059562d8516.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/fetch_corpus/7a300059562d8516.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/fetch_corpus/94bfe6f3e6b7f5b6.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/fetch_corpus/94bfe6f3e6b7f5b6.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/fetch_corpus/964b2edd4c3ea38a.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/fetch_corpus/964b2edd4c3ea38a.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/fetch_corpus/a649c02cc49a8bb2.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/fetch_corpus/a649c02cc49a8bb2.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/fetch_corpus/c4148da8ae82dbaa.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/fetch_corpus/c4148da8ae82dbaa.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/fetch_corpus/dfa8b86a3e01c37c.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/fetch_corpus/dfa8b86a3e01c37c.json +0 -12
- mcpsec-2.7.0/mcpsec_corpus/fetch_corpus/ec9ce5c5161382d0.bin +0 -1
- mcpsec-2.7.0/mcpsec_corpus/fetch_corpus/ec9ce5c5161382d0.json +0 -12
- mcpsec-2.7.0/mcpsec_crashes/crash_24482bed0370e24d.bin +0 -1
- mcpsec-2.7.0/mcpsec_crashes/crash_24482bed0370e24d.json +0 -7
- mcpsec-2.7.0/mcpsec_crashes/crash_245255d1b0fdd47c.bin +0 -1
- mcpsec-2.7.0/mcpsec_crashes/crash_245255d1b0fdd47c.json +0 -7
- mcpsec-2.7.0/mcpsec_crashes/crash_71d2c5112543060c.bin +0 -1
- mcpsec-2.7.0/mcpsec_crashes/crash_71d2c5112543060c.json +0 -7
- mcpsec-2.7.0/mcpsec_crashes/crash_8e6bb8b15eaabe05.bin +0 -1
- mcpsec-2.7.0/mcpsec_crashes/crash_8e6bb8b15eaabe05.json +0 -7
- mcpsec-2.7.0/mcpsec_crashes/crash_b1181fc12b56b288.bin +0 -1
- mcpsec-2.7.0/mcpsec_crashes/crash_b1181fc12b56b288.json +0 -7
- mcpsec-2.7.0/mcpsec_crashes/crash_c06663fda69f3c4e.bin +0 -1
- mcpsec-2.7.0/mcpsec_crashes/crash_c06663fda69f3c4e.json +0 -7
- mcpsec-2.7.0/mcpsec_crashes/crash_c935ce06ff81e99e.bin +0 -1
- mcpsec-2.7.0/mcpsec_crashes/crash_c935ce06ff81e99e.json +0 -7
- mcpsec-2.7.0/mcpsec_crashes/evolve_report.json +0 -62
- mcpsec-2.7.0/mcpsec_crashes/evolve_report11.json +0 -57
- {mcpsec-2.7.0 → mcpsec-2.7.2}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/.github/workflows/ci.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/.github/workflows/release.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/CONTRIBUTING.md +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/LICENSE +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/SECURITY.md +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/assets/demo.gif +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/ai/__init__.py +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/exclusions.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-ast-sandbox-escape.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-broad-command-injection.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-broad-path-traversal.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-broad-sql-injection.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-capability-issues.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-code-smells.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-command-injection.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-dangerous-defaults.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-dangerous-eval.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-description-injection.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-deserialization.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-dotnet-injection.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-go-injection.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-indirect-injection.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-path-traversal.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-protocol-handler.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-python-async.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-python-broad.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-python-injection.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-resource-uri.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-rust-injection.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-secrets-exposure.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-secrets-hardcoded.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-server-patterns.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-sql-injection.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-ssrf-patterns.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/rules/mcp-taint-sinks.yml +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/mcpsec/static/__init__.py +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/shell.nix +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/tests/__init__.py +0 -0
- /mcpsec-2.7.0/mcpsec_corpus/17e2d626f2debc2c.json → /mcpsec-2.7.2/tests/servers/__init__.py +0 -0
- {mcpsec-2.7.0/tests → mcpsec-2.7.2/tests/servers}/blind_test.py +0 -0
- {mcpsec-2.7.0/tests → mcpsec-2.7.2/tests/servers}/dangerous_server.py +0 -0
- {mcpsec-2.7.0/tests → mcpsec-2.7.2/tests/servers}/noisy_test_server.py +0 -0
- {mcpsec-2.7.0/tests → mcpsec-2.7.2/tests/servers}/stateful_test_server.py +0 -0
- {mcpsec-2.7.0/tests → mcpsec-2.7.2/tests/servers}/stress_test_server.py +0 -0
- {mcpsec-2.7.0/tests → mcpsec-2.7.2/tests/servers}/vulnerable_db_server.py +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/tests/test_config.py +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/tests/test_exploit.py +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/tests/test_fuzzer.py +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/tests/test_sarif.py +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/tests/test_scanners.py +0 -0
- {mcpsec-2.7.0 → mcpsec-2.7.2}/tests/test_semgrep_rules.py +0 -0
|
@@ -5,6 +5,40 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.7.2] - 2026-07-12
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- **Codebase Cleanup & Deduplication**: Removed 156 duplicate regexes and consolidated 3,459 sink patterns into 9 organized files by vulnerability type.
|
|
12
|
+
- **Generator Consolidation**: Merged protocol_state generators and renamed memory_exhaustion_v2 for better maintainability.
|
|
13
|
+
- **Dead Code Removal**: Removed unused AI analyzer stubs ( aint_analyzer, py_analyzer) and SQL exploiter stubs.
|
|
14
|
+
- **Test Organization**: Moved test server fixtures from ests/ to ests/servers/ for cleaner separation of tests and fixtures.
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
- **Silent Exception Handling**: Replaced bare except: pass blocks across 130+ files with proper logger.debug statements.
|
|
18
|
+
- **Unicode Errors on Windows**: Fixed UnicodeEncodeError crashes caused by rich console emojis by forcing UTF-8 stdout encoding.
|
|
19
|
+
- **Unused Imports**: Cleaned up stale imports in cli.py.
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [2.7.1] - 2026-04-15
|
|
23
|
+
|
|
24
|
+
### Improved
|
|
25
|
+
- **Pattern expansion**: 3,450+ sink patterns (up from ~800), covering Python, TypeScript, Go, Rust, C/C++, Java, Ruby, PHP
|
|
26
|
+
- **Sanitizer patterns**: 105 patterns to detect when dangerous sinks are properly sanitized
|
|
27
|
+
- **MCP source patterns**: 45 patterns for framework-aware detection across 20+ MCP SDKs
|
|
28
|
+
- **Detection accuracy**: 100% on internal test suite (13/13 vulnerabilities detected in blind_test.py)
|
|
29
|
+
- **AI classification**: Improved 5-level severity system (🔴🟠🟡🔵⚪) with better server-type awareness
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
- Multi-line pattern matching (subprocess with shell=True across multiple lines now detected)
|
|
33
|
+
- Variable SQL injection detection (cursor.execute(variable) where variable is f-string)
|
|
34
|
+
- eval() detection with nested parentheses
|
|
35
|
+
- Duplicate finding deduplication (same sink no longer reported multiple times)
|
|
36
|
+
- Heuristic confidence filter (medium-confidence sinks no longer dropped)
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
- `--include-tests` flag to include test file findings (excluded by default)
|
|
40
|
+
- Server-type detection for better by-design classification (filesystem, fetch, database servers)
|
|
41
|
+
|
|
8
42
|
## v2.7.0 (2026-03-23)
|
|
9
43
|
|
|
10
44
|
### New Features
|
|
@@ -281,4 +315,4 @@ mcpsec evolve --stdio "server" --corpus ./corpus --crashes ./crashes
|
|
|
281
315
|
- Protocol fuzzer with 500+ test cases
|
|
282
316
|
- AI-powered payload generation
|
|
283
317
|
- Semgrep-based static analysis
|
|
284
|
-
- Support for OpenAI, Anthropic, Google, Groq, DeepSeek, Ollama
|
|
318
|
+
- Support for OpenAI, Anthropic, Google, Groq, DeepSeek, Ollama
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: mcpsec
|
|
3
|
-
Version: 2.7.
|
|
3
|
+
Version: 2.7.2
|
|
4
4
|
Summary: Security scanner for MCP (Model Context Protocol) servers - pentest your AI agent's tool connections
|
|
5
5
|
Project-URL: Homepage, https://github.com/manthanghasadiya/mcpsec
|
|
6
6
|
Project-URL: Documentation, https://github.com/manthanghasadiya/mcpsec#readme
|
|
@@ -53,12 +53,14 @@ Description-Content-Type: text/markdown
|
|
|
53
53
|
[](https://www.python.org/downloads/)
|
|
54
54
|
[](https://pypi.org/project/mcpsec/)
|
|
55
55
|
[](https://github.com/manthanghasadiya/mcpsec/actions/workflows/ci.yml)
|
|
56
|
-
[](https://github.com/manthanghasadiya/mcpsec)
|
|
57
|
+
[](https://github.com/manthanghasadiya/mcpsec)
|
|
58
|
+
[](https://github.com/manthanghasadiya/mcpsec)
|
|
58
59
|
[](https://github.com/manthanghasadiya/mcpsec)
|
|
60
|
+
[](https://github.com/manthanghasadiya/mcpsec)
|
|
59
61
|
[](https://github.com/manthanghasadiya/mcpsec)
|
|
60
62
|
|
|
61
|
-
[Installation](#installation) • [Quick Start](#quick-start) • [Scanners](#scanners) • [Fuzzing](#fuzz-generators)
|
|
63
|
+
[Installation](#installation) • [Quick Start](#quick-start) • [Audit v3](#static-analysis-audit-v3) • [Scanners](#scanners) • [Fuzzing](#fuzz-generators)
|
|
62
64
|
|
|
63
65
|
</div>
|
|
64
66
|
|
|
@@ -76,14 +78,18 @@ Most MCP security tools do static analysis. **mcpsec connects to live servers an
|
|
|
76
78
|
|
|
77
79
|
## Real Bugs Found
|
|
78
80
|
|
|
79
|
-
| Target | Vulnerability | Status |
|
|
80
|
-
|
|
81
|
-
| **
|
|
82
|
-
| **
|
|
83
|
-
|
|
|
84
|
-
| mcp
|
|
85
|
-
| mcp
|
|
86
|
-
| MCP
|
|
81
|
+
| Target | Vulnerability | Severity | Status |
|
|
82
|
+
|--------|---------------|----------|--------|
|
|
83
|
+
| **mobile-mcp** | URL Scheme Injection (CVE-2026-35394, CVSS 8.3) - Arbitrary code execution via unsanitized tool input | High | [Fixed - PR #299](https://github.com/mobile-next/mobile-mcp/pull/299) |
|
|
84
|
+
| **MCP Python SDK** | ClosedResourceError DoS (invalid UTF-8) | High | [Issue #2328](https://github.com/modelcontextprotocol/python-sdk/issues/2328) - Fix in [PR #2334](https://github.com/modelcontextprotocol/python-sdk/pull/2334) |
|
|
85
|
+
| **radare2-mcp** | Arbitrary RCE via shell escape (!) in run_command/run_javascript | Critical | [Issue #45](https://github.com/radareorg/radare2-mcp/issues/45) - Fixed in [commit 482cde6](https://github.com/radareorg/radare2-mcp/commit/482cde6) |
|
|
86
|
+
| **radare2-mcp** | Multiple SIGSEGV via params type confusion | High | [Issue #42](https://github.com/radareorg/radare2-mcp/issues/42) |
|
|
87
|
+
| **radare2-mcp** | SIGSEGV in initialize via params type confusion | High | [Issue #52](https://github.com/radareorg/radare2-mcp/issues/52) |
|
|
88
|
+
| MCP Python SDK | UnicodeDecodeError DoS | Medium | [Fixed - PR #2302](https://github.com/modelcontextprotocol/python-sdk/pull/2302) |
|
|
89
|
+
| mcp-server-fetch | 61 crash cases, exception handling DoS | High | [Issue #3359](https://github.com/modelcontextprotocol/servers/issues/3359) |
|
|
90
|
+
| mcp-server-git | 61 crash cases | High | [Issue #3359](https://github.com/modelcontextprotocol/servers/issues/3359) |
|
|
91
|
+
| MCP TypeScript SDK | EPIPE crash | Medium | [Issue #1564](https://github.com/modelcontextprotocol/typescript-sdk/issues/1564) |
|
|
92
|
+
| MCP TypeScript SDK | Integer overflow DoS (MAX_SAFE_INTEGER+1) | Medium | [Issue #1765](https://github.com/modelcontextprotocol/typescript-sdk/issues/1765) |
|
|
87
93
|
|
|
88
94
|
More findings under responsible disclosure.
|
|
89
95
|
|
|
@@ -126,6 +132,21 @@ mcpsec scan --auto
|
|
|
126
132
|
mcpsec info --stdio "python my_server.py"
|
|
127
133
|
```
|
|
128
134
|
|
|
135
|
+
### Static Analysis (Audit v3)
|
|
136
|
+
```bash
|
|
137
|
+
# Local source - pattern-based + AI reachability
|
|
138
|
+
mcpsec audit --path ./my-mcp-server
|
|
139
|
+
|
|
140
|
+
# GitHub repository
|
|
141
|
+
mcpsec audit --github https://github.com/user/mcp-server
|
|
142
|
+
|
|
143
|
+
# With LLM-powered taint analysis
|
|
144
|
+
mcpsec audit --github https://github.com/user/mcp-server --ai
|
|
145
|
+
|
|
146
|
+
# Known vulnerable servers
|
|
147
|
+
mcpsec audit --github https://github.com/radareorg/radare2-mcp
|
|
148
|
+
```
|
|
149
|
+
|
|
129
150
|
### Protocol Fuzzing
|
|
130
151
|
```bash
|
|
131
152
|
# Standard fuzzing (~200 cases)
|
|
@@ -138,18 +159,6 @@ mcpsec fuzz --stdio "python my_server.py" --intensity high
|
|
|
138
159
|
mcpsec fuzz --stdio "python my_server.py" --ai
|
|
139
160
|
```
|
|
140
161
|
|
|
141
|
-
### Static Analysis
|
|
142
|
-
```bash
|
|
143
|
-
# Local source
|
|
144
|
-
mcpsec audit --path ./my-mcp-server
|
|
145
|
-
|
|
146
|
-
# GitHub repository
|
|
147
|
-
mcpsec audit --github https://github.com/user/mcp-server
|
|
148
|
-
|
|
149
|
-
# With AI validation
|
|
150
|
-
mcpsec audit --github https://github.com/user/mcp-server --ai
|
|
151
|
-
```
|
|
152
|
-
|
|
153
162
|
### Advanced
|
|
154
163
|
```bash
|
|
155
164
|
# SQL Injection scanner with DB fingerprinting
|
|
@@ -167,6 +176,55 @@ mcpsec rogue-server --port 9999 --attack all
|
|
|
167
176
|
|
|
168
177
|
---
|
|
169
178
|
|
|
179
|
+
## Static Analysis - Audit v3
|
|
180
|
+
|
|
181
|
+
> **New in v2.7.1** - Complete rewrite of the audit engine with a pattern-based architecture.
|
|
182
|
+
|
|
183
|
+
### 7-Stage Analysis Pipeline
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
Source Code
|
|
187
|
+
│
|
|
188
|
+
├─ 1. Fetch - Clone GitHub repo or load local path
|
|
189
|
+
├─ 2. Detect - Identify language, MCP SDK, and framework
|
|
190
|
+
├─ 3. Sink Scan - 3,450+ regex patterns across 12 languages
|
|
191
|
+
├─ 4. Semgrep - 149 semantic rules (AST-level)
|
|
192
|
+
├─ 5. AST - Python/JS taint flow analysis
|
|
193
|
+
├─ 6. Reachability - LLM taint tracing (heuristic fallback)
|
|
194
|
+
└─ 7. Deduplicate - Merge, rank, and report findings
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Pattern Database - 3,450+ Sink Patterns
|
|
198
|
+
|
|
199
|
+
| Vulnerability Class | Patterns | Languages |
|
|
200
|
+
|--------------------|----------|-----------|
|
|
201
|
+
| Command Injection | 181 | Python, JS/TS, Go, Rust, Java, C, C#, Ruby, PHP |
|
|
202
|
+
| SQL / NoSQL Injection | ~100 | All drivers + ORM-specific (Sequelize, SQLAlchemy, Drizzle, Kysely) |
|
|
203
|
+
| Path Traversal | ~60 | fs, aiofiles, Deno, Bun, tarfile, ZipSlip |
|
|
204
|
+
| SSRF | ~80 | requests, httpx, aiohttp, gRPC, OkHttp, WebSocket, got |
|
|
205
|
+
| Deserialization | ~60 | pickle, YAML, torch.load, numpy, joblib, BinaryFormatter |
|
|
206
|
+
| Code Execution | ~50 | eval, vm, exec, DOM XSS, format strings |
|
|
207
|
+
| Template Injection | ~30 | Jinja2, Pug, EJS, Handlebars, Lodash, ERB, Velocity, Thymeleaf |
|
|
208
|
+
| Crypto Weaknesses | ~40 | MD5/SHA-1, RC4, weak keys, JWT `none` alg |
|
|
209
|
+
| XXE | ~25 | lxml, untangle, DOMDocument, SAXParser |
|
|
210
|
+
| Log/Header/LDAP | ~50 | All major frameworks |
|
|
211
|
+
| Prototype Pollution | ~15 | Object.assign, deepmerge, `__proto__` |
|
|
212
|
+
| Sanitizers | 105 | Command, SQL, Path, XSS sanitizers (Python, JS, Go, Rust) |
|
|
213
|
+
| MCP-Specific | ~45 | Tool args → sinks, prompt/resource handlers (20+ SDKs) |
|
|
214
|
+
|
|
215
|
+
### Framework Detection
|
|
216
|
+
|
|
217
|
+
Automatically identifies:
|
|
218
|
+
- **MCP SDKs**: `@modelcontextprotocol/sdk`, `mcp` (Python), `mcp-go`, `rmcp` (Rust), `mcpx` (C#)
|
|
219
|
+
- **Languages**: TypeScript, JavaScript, Python, Go, Rust, Java, C#, PHP, Ruby, C/C++
|
|
220
|
+
- **Frameworks**: Express, FastAPI, Django, Gin, Axum, Spring Boot, ASP.NET
|
|
221
|
+
|
|
222
|
+
### Heuristic Fallback
|
|
223
|
+
|
|
224
|
+
When no LLM is configured, the reachability analyzer uses **confidence scoring** to report findings without false silence - high-confidence patterns (CRITICAL/HIGH + direct taint) are always reported.
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
170
228
|
## Scanners
|
|
171
229
|
|
|
172
230
|
| Scanner | Description |
|
|
@@ -198,21 +256,9 @@ mcpsec rogue-server --port 9999 --attack all
|
|
|
198
256
|
|
|
199
257
|
**Medium (~200 cases):** + `session_attacks`, `encoding_attacks`, `integer_boundaries`
|
|
200
258
|
|
|
201
|
-
**High (~800 cases):** + `injection_payloads`, `method_mutations`, `param_mutations`, `timing_attacks`, `header_mutations`, `json_edge_cases`, `protocol_state`, `
|
|
202
|
-
|
|
203
|
-
**Insane (~1500+ cases):** + `resource_exhaustion`, `memory_exhaustion_v2`
|
|
204
|
-
|
|
205
|
-
---
|
|
206
|
-
|
|
207
|
-
## Static Analysis (149 Semgrep Rules)
|
|
208
|
-
|
|
209
|
-
24 rule files covering:
|
|
259
|
+
**High (~800 cases):** + `injection_payloads`, `method_mutations`, `param_mutations`, `timing_attacks`, `header_mutations`, `json_edge_cases`, `protocol_state`, `id_confusion`, `concurrency_attacks`, `regex_dos`, `deserialization`
|
|
210
260
|
|
|
211
|
-
|
|
212
|
-
- **Network:** SSRF patterns, resource URI issues
|
|
213
|
-
- **Secrets:** AWS keys, API tokens, JWT secrets, connection strings, private keys
|
|
214
|
-
- **MCP-Specific:** Dangerous tool names, empty schemas, input reflection, missing auth
|
|
215
|
-
- **Code Quality:** Security TODOs, empty catches, TLS disabled, CORS *, ReDoS patterns
|
|
261
|
+
**Insane (~1500+ cases):** + `resource_exhaustion`, `memory_exhaustion`
|
|
216
262
|
|
|
217
263
|
---
|
|
218
264
|
|
|
@@ -225,9 +271,10 @@ mcpsec rogue-server --port 9999 --attack all
|
|
|
225
271
|
└────┬────┘ └────────────┘
|
|
226
272
|
│
|
|
227
273
|
├── Connect & enumerate attack surface
|
|
228
|
-
├── Run 10+ security scanners
|
|
274
|
+
├── Run 10+ security scanners
|
|
229
275
|
├── Generate 800+ fuzz cases
|
|
230
276
|
├── Execute AI-powered payload mutations
|
|
277
|
+
├── Static audit: 3,450+ sink patterns + 149 Semgrep rules
|
|
231
278
|
└── Report findings with PoC evidence
|
|
232
279
|
```
|
|
233
280
|
|
|
@@ -252,71 +299,7 @@ mcpsec fuzz --stdio "server" --output results.sarif
|
|
|
252
299
|
|
|
253
300
|
---
|
|
254
301
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
### v2.6.1 (2026-03-20)
|
|
258
|
-
- CI/CD pipeline with GitHub Actions for automated testing and PyPI releases
|
|
259
|
-
- PR and Issue templates for better community contributions
|
|
260
|
-
- Nix package support via `shell.nix` for reproducible builds (@AbhiTheModder)
|
|
261
|
-
- Environment variables now properly inherited in `mcp_client.py` (@AbhiTheModder)
|
|
262
|
-
|
|
263
|
-
### v2.6.0 (2026-03-13)
|
|
264
|
-
- **Auto-Discovery Scanner**: New `--auto` flag to automatically find and scan MCP servers from Claude, Cursor, VS Code, Windsurf, etc.
|
|
265
|
-
- **Windows Unicode Fixes**: Comprehensive fix for `UnicodeEncodeError` on Windows consoles.
|
|
266
|
-
- **Pydantic Compatibility**: Resolved `AttributeError` for custom metadata in scan results.
|
|
267
|
-
|
|
268
|
-
### v2.5.0 (2026-03-04)
|
|
269
|
-
- **New Scanners**: `code-execution`, `template-injection`, `rag-poisoning`, `idor`, `info-leak`, `deserialization`
|
|
270
|
-
- **Confirmation Proofs**: Added `mcpsec_cmd_success` execution anchor for command injection
|
|
271
|
-
- **SSRF Expansion**: Support for `file://` protocol and generic fetch success indicators
|
|
272
|
-
- **Robust Parameter Handling**: Automatic dummy argument generation for complex tool schemas
|
|
273
|
-
- **Enhanced Classification**: Massive reduction in false positives for blocked/sandboxed tools
|
|
274
|
-
|
|
275
|
-
### v2.4.0 (2026-02-28)
|
|
276
|
-
- **SAST Rules Expansion**: 87 new Semgrep rules → **149 total** across 24 rule files
|
|
277
|
-
- Broad patterns for command injection, path traversal, SQL injection, SSRF, deserialization
|
|
278
|
-
- Secrets detection: AWS keys, AI API keys, GitHub/Slack tokens, JWT secrets
|
|
279
|
-
- MCP-specific rules: dangerous tool names, empty schemas, error leaks, input reflection
|
|
280
|
-
- Code smells: security TODOs, empty catches, TLS disabled, CORS *, ReDoS patterns
|
|
281
|
-
|
|
282
|
-
### v2.3.0 (2026-02-28)
|
|
283
|
-
- **Scanner Nuclear Expansion**: Command injection (138), path traversal (104), SSRF (81) payloads
|
|
284
|
-
- Encoding bypasses, protocol smuggling, shell-specific evasion
|
|
285
|
-
- 5 new fuzz generators: integer boundaries, concurrency, memory exhaustion, regex DoS, deserialization
|
|
286
|
-
- SDK-specific Semgrep rules for Go, Rust, Python async, .NET
|
|
287
|
-
|
|
288
|
-
### v2.2.0 (2026-02-28)
|
|
289
|
-
- **SARIF 2.1.0 Output** for CI/CD integration
|
|
290
|
-
- CWE mapping and severity scoring
|
|
291
|
-
- Audit report export with `--output` and `--format` flags
|
|
292
|
-
|
|
293
|
-
### v2.1.0 (2026-02-27)
|
|
294
|
-
- **AI Exploitation Assistant**: `select`, `run`, `next`, `verdict`, `auto` REPL commands
|
|
295
|
-
- Expert controls: `edit`, `aggressive`, `hint` for complex bypasses
|
|
296
|
-
- AI learns from manual `call` commands and response history
|
|
297
|
-
|
|
298
|
-
### v2.0.3 (2026-02-26)
|
|
299
|
-
- **MCP Repeater**: Interactive REPL for manual/semi-auto finding validation
|
|
300
|
-
- AI payload engine with context-aware recommendations
|
|
301
|
-
- Exploit playbooks for SQLi, RCE, SSRF, path traversal
|
|
302
|
-
- Automated evidence capture and PoC generation
|
|
303
|
-
|
|
304
|
-
<details>
|
|
305
|
-
<summary>Earlier versions</summary>
|
|
306
|
-
|
|
307
|
-
### v2.0.2 (2026-02-26)
|
|
308
|
-
- Tool chain analysis for dangerous combinations
|
|
309
|
-
- Cross-platform Windows support improvements
|
|
310
|
-
|
|
311
|
-
### v2.0.1 (2026-02-25)
|
|
312
|
-
- Advanced SQL scanner with modular detection
|
|
313
|
-
- DB fingerprinting for MySQL, Postgres, MSSQL, SQLite
|
|
314
|
-
|
|
315
|
-
### v2.0.0 (2026-02-24)
|
|
316
|
-
- Fuzzing engine v2 with chained state-machine exploration
|
|
317
|
-
- AI-powered validation of security findings
|
|
318
|
-
|
|
319
|
-
</details>
|
|
302
|
+
See [CHANGELOG.md](CHANGELOG.md) for the full release history.
|
|
320
303
|
|
|
321
304
|
---
|
|
322
305
|
|
|
@@ -324,7 +307,7 @@ mcpsec fuzz --stdio "server" --output results.sarif
|
|
|
324
307
|
|
|
325
308
|
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
326
309
|
|
|
327
|
-
CI runs automatically on all PRs
|
|
310
|
+
CI runs automatically on all PRs - linting with Ruff and cross-platform tests (Ubuntu, Windows, macOS).
|
|
328
311
|
|
|
329
312
|
---
|
|
330
313
|
|
|
@@ -8,12 +8,14 @@
|
|
|
8
8
|
[](https://www.python.org/downloads/)
|
|
9
9
|
[](https://pypi.org/project/mcpsec/)
|
|
10
10
|
[](https://github.com/manthanghasadiya/mcpsec/actions/workflows/ci.yml)
|
|
11
|
-
[](https://github.com/manthanghasadiya/mcpsec)
|
|
12
|
+
[](https://github.com/manthanghasadiya/mcpsec)
|
|
13
|
+
[](https://github.com/manthanghasadiya/mcpsec)
|
|
13
14
|
[](https://github.com/manthanghasadiya/mcpsec)
|
|
15
|
+
[](https://github.com/manthanghasadiya/mcpsec)
|
|
14
16
|
[](https://github.com/manthanghasadiya/mcpsec)
|
|
15
17
|
|
|
16
|
-
[Installation](#installation) • [Quick Start](#quick-start) • [Scanners](#scanners) • [Fuzzing](#fuzz-generators)
|
|
18
|
+
[Installation](#installation) • [Quick Start](#quick-start) • [Audit v3](#static-analysis-audit-v3) • [Scanners](#scanners) • [Fuzzing](#fuzz-generators)
|
|
17
19
|
|
|
18
20
|
</div>
|
|
19
21
|
|
|
@@ -31,14 +33,18 @@ Most MCP security tools do static analysis. **mcpsec connects to live servers an
|
|
|
31
33
|
|
|
32
34
|
## Real Bugs Found
|
|
33
35
|
|
|
34
|
-
| Target | Vulnerability | Status |
|
|
35
|
-
|
|
36
|
-
| **
|
|
37
|
-
| **
|
|
38
|
-
|
|
|
39
|
-
| mcp
|
|
40
|
-
| mcp
|
|
41
|
-
| MCP
|
|
36
|
+
| Target | Vulnerability | Severity | Status |
|
|
37
|
+
|--------|---------------|----------|--------|
|
|
38
|
+
| **mobile-mcp** | URL Scheme Injection (CVE-2026-35394, CVSS 8.3) - Arbitrary code execution via unsanitized tool input | High | [Fixed - PR #299](https://github.com/mobile-next/mobile-mcp/pull/299) |
|
|
39
|
+
| **MCP Python SDK** | ClosedResourceError DoS (invalid UTF-8) | High | [Issue #2328](https://github.com/modelcontextprotocol/python-sdk/issues/2328) - Fix in [PR #2334](https://github.com/modelcontextprotocol/python-sdk/pull/2334) |
|
|
40
|
+
| **radare2-mcp** | Arbitrary RCE via shell escape (!) in run_command/run_javascript | Critical | [Issue #45](https://github.com/radareorg/radare2-mcp/issues/45) - Fixed in [commit 482cde6](https://github.com/radareorg/radare2-mcp/commit/482cde6) |
|
|
41
|
+
| **radare2-mcp** | Multiple SIGSEGV via params type confusion | High | [Issue #42](https://github.com/radareorg/radare2-mcp/issues/42) |
|
|
42
|
+
| **radare2-mcp** | SIGSEGV in initialize via params type confusion | High | [Issue #52](https://github.com/radareorg/radare2-mcp/issues/52) |
|
|
43
|
+
| MCP Python SDK | UnicodeDecodeError DoS | Medium | [Fixed - PR #2302](https://github.com/modelcontextprotocol/python-sdk/pull/2302) |
|
|
44
|
+
| mcp-server-fetch | 61 crash cases, exception handling DoS | High | [Issue #3359](https://github.com/modelcontextprotocol/servers/issues/3359) |
|
|
45
|
+
| mcp-server-git | 61 crash cases | High | [Issue #3359](https://github.com/modelcontextprotocol/servers/issues/3359) |
|
|
46
|
+
| MCP TypeScript SDK | EPIPE crash | Medium | [Issue #1564](https://github.com/modelcontextprotocol/typescript-sdk/issues/1564) |
|
|
47
|
+
| MCP TypeScript SDK | Integer overflow DoS (MAX_SAFE_INTEGER+1) | Medium | [Issue #1765](https://github.com/modelcontextprotocol/typescript-sdk/issues/1765) |
|
|
42
48
|
|
|
43
49
|
More findings under responsible disclosure.
|
|
44
50
|
|
|
@@ -81,6 +87,21 @@ mcpsec scan --auto
|
|
|
81
87
|
mcpsec info --stdio "python my_server.py"
|
|
82
88
|
```
|
|
83
89
|
|
|
90
|
+
### Static Analysis (Audit v3)
|
|
91
|
+
```bash
|
|
92
|
+
# Local source - pattern-based + AI reachability
|
|
93
|
+
mcpsec audit --path ./my-mcp-server
|
|
94
|
+
|
|
95
|
+
# GitHub repository
|
|
96
|
+
mcpsec audit --github https://github.com/user/mcp-server
|
|
97
|
+
|
|
98
|
+
# With LLM-powered taint analysis
|
|
99
|
+
mcpsec audit --github https://github.com/user/mcp-server --ai
|
|
100
|
+
|
|
101
|
+
# Known vulnerable servers
|
|
102
|
+
mcpsec audit --github https://github.com/radareorg/radare2-mcp
|
|
103
|
+
```
|
|
104
|
+
|
|
84
105
|
### Protocol Fuzzing
|
|
85
106
|
```bash
|
|
86
107
|
# Standard fuzzing (~200 cases)
|
|
@@ -93,18 +114,6 @@ mcpsec fuzz --stdio "python my_server.py" --intensity high
|
|
|
93
114
|
mcpsec fuzz --stdio "python my_server.py" --ai
|
|
94
115
|
```
|
|
95
116
|
|
|
96
|
-
### Static Analysis
|
|
97
|
-
```bash
|
|
98
|
-
# Local source
|
|
99
|
-
mcpsec audit --path ./my-mcp-server
|
|
100
|
-
|
|
101
|
-
# GitHub repository
|
|
102
|
-
mcpsec audit --github https://github.com/user/mcp-server
|
|
103
|
-
|
|
104
|
-
# With AI validation
|
|
105
|
-
mcpsec audit --github https://github.com/user/mcp-server --ai
|
|
106
|
-
```
|
|
107
|
-
|
|
108
117
|
### Advanced
|
|
109
118
|
```bash
|
|
110
119
|
# SQL Injection scanner with DB fingerprinting
|
|
@@ -122,6 +131,55 @@ mcpsec rogue-server --port 9999 --attack all
|
|
|
122
131
|
|
|
123
132
|
---
|
|
124
133
|
|
|
134
|
+
## Static Analysis - Audit v3
|
|
135
|
+
|
|
136
|
+
> **New in v2.7.1** - Complete rewrite of the audit engine with a pattern-based architecture.
|
|
137
|
+
|
|
138
|
+
### 7-Stage Analysis Pipeline
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
Source Code
|
|
142
|
+
│
|
|
143
|
+
├─ 1. Fetch - Clone GitHub repo or load local path
|
|
144
|
+
├─ 2. Detect - Identify language, MCP SDK, and framework
|
|
145
|
+
├─ 3. Sink Scan - 3,450+ regex patterns across 12 languages
|
|
146
|
+
├─ 4. Semgrep - 149 semantic rules (AST-level)
|
|
147
|
+
├─ 5. AST - Python/JS taint flow analysis
|
|
148
|
+
├─ 6. Reachability - LLM taint tracing (heuristic fallback)
|
|
149
|
+
└─ 7. Deduplicate - Merge, rank, and report findings
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Pattern Database - 3,450+ Sink Patterns
|
|
153
|
+
|
|
154
|
+
| Vulnerability Class | Patterns | Languages |
|
|
155
|
+
|--------------------|----------|-----------|
|
|
156
|
+
| Command Injection | 181 | Python, JS/TS, Go, Rust, Java, C, C#, Ruby, PHP |
|
|
157
|
+
| SQL / NoSQL Injection | ~100 | All drivers + ORM-specific (Sequelize, SQLAlchemy, Drizzle, Kysely) |
|
|
158
|
+
| Path Traversal | ~60 | fs, aiofiles, Deno, Bun, tarfile, ZipSlip |
|
|
159
|
+
| SSRF | ~80 | requests, httpx, aiohttp, gRPC, OkHttp, WebSocket, got |
|
|
160
|
+
| Deserialization | ~60 | pickle, YAML, torch.load, numpy, joblib, BinaryFormatter |
|
|
161
|
+
| Code Execution | ~50 | eval, vm, exec, DOM XSS, format strings |
|
|
162
|
+
| Template Injection | ~30 | Jinja2, Pug, EJS, Handlebars, Lodash, ERB, Velocity, Thymeleaf |
|
|
163
|
+
| Crypto Weaknesses | ~40 | MD5/SHA-1, RC4, weak keys, JWT `none` alg |
|
|
164
|
+
| XXE | ~25 | lxml, untangle, DOMDocument, SAXParser |
|
|
165
|
+
| Log/Header/LDAP | ~50 | All major frameworks |
|
|
166
|
+
| Prototype Pollution | ~15 | Object.assign, deepmerge, `__proto__` |
|
|
167
|
+
| Sanitizers | 105 | Command, SQL, Path, XSS sanitizers (Python, JS, Go, Rust) |
|
|
168
|
+
| MCP-Specific | ~45 | Tool args → sinks, prompt/resource handlers (20+ SDKs) |
|
|
169
|
+
|
|
170
|
+
### Framework Detection
|
|
171
|
+
|
|
172
|
+
Automatically identifies:
|
|
173
|
+
- **MCP SDKs**: `@modelcontextprotocol/sdk`, `mcp` (Python), `mcp-go`, `rmcp` (Rust), `mcpx` (C#)
|
|
174
|
+
- **Languages**: TypeScript, JavaScript, Python, Go, Rust, Java, C#, PHP, Ruby, C/C++
|
|
175
|
+
- **Frameworks**: Express, FastAPI, Django, Gin, Axum, Spring Boot, ASP.NET
|
|
176
|
+
|
|
177
|
+
### Heuristic Fallback
|
|
178
|
+
|
|
179
|
+
When no LLM is configured, the reachability analyzer uses **confidence scoring** to report findings without false silence - high-confidence patterns (CRITICAL/HIGH + direct taint) are always reported.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
125
183
|
## Scanners
|
|
126
184
|
|
|
127
185
|
| Scanner | Description |
|
|
@@ -153,21 +211,9 @@ mcpsec rogue-server --port 9999 --attack all
|
|
|
153
211
|
|
|
154
212
|
**Medium (~200 cases):** + `session_attacks`, `encoding_attacks`, `integer_boundaries`
|
|
155
213
|
|
|
156
|
-
**High (~800 cases):** + `injection_payloads`, `method_mutations`, `param_mutations`, `timing_attacks`, `header_mutations`, `json_edge_cases`, `protocol_state`, `
|
|
157
|
-
|
|
158
|
-
**Insane (~1500+ cases):** + `resource_exhaustion`, `memory_exhaustion_v2`
|
|
159
|
-
|
|
160
|
-
---
|
|
161
|
-
|
|
162
|
-
## Static Analysis (149 Semgrep Rules)
|
|
163
|
-
|
|
164
|
-
24 rule files covering:
|
|
214
|
+
**High (~800 cases):** + `injection_payloads`, `method_mutations`, `param_mutations`, `timing_attacks`, `header_mutations`, `json_edge_cases`, `protocol_state`, `id_confusion`, `concurrency_attacks`, `regex_dos`, `deserialization`
|
|
165
215
|
|
|
166
|
-
|
|
167
|
-
- **Network:** SSRF patterns, resource URI issues
|
|
168
|
-
- **Secrets:** AWS keys, API tokens, JWT secrets, connection strings, private keys
|
|
169
|
-
- **MCP-Specific:** Dangerous tool names, empty schemas, input reflection, missing auth
|
|
170
|
-
- **Code Quality:** Security TODOs, empty catches, TLS disabled, CORS *, ReDoS patterns
|
|
216
|
+
**Insane (~1500+ cases):** + `resource_exhaustion`, `memory_exhaustion`
|
|
171
217
|
|
|
172
218
|
---
|
|
173
219
|
|
|
@@ -180,9 +226,10 @@ mcpsec rogue-server --port 9999 --attack all
|
|
|
180
226
|
└────┬────┘ └────────────┘
|
|
181
227
|
│
|
|
182
228
|
├── Connect & enumerate attack surface
|
|
183
|
-
├── Run 10+ security scanners
|
|
229
|
+
├── Run 10+ security scanners
|
|
184
230
|
├── Generate 800+ fuzz cases
|
|
185
231
|
├── Execute AI-powered payload mutations
|
|
232
|
+
├── Static audit: 3,450+ sink patterns + 149 Semgrep rules
|
|
186
233
|
└── Report findings with PoC evidence
|
|
187
234
|
```
|
|
188
235
|
|
|
@@ -207,71 +254,7 @@ mcpsec fuzz --stdio "server" --output results.sarif
|
|
|
207
254
|
|
|
208
255
|
---
|
|
209
256
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
### v2.6.1 (2026-03-20)
|
|
213
|
-
- CI/CD pipeline with GitHub Actions for automated testing and PyPI releases
|
|
214
|
-
- PR and Issue templates for better community contributions
|
|
215
|
-
- Nix package support via `shell.nix` for reproducible builds (@AbhiTheModder)
|
|
216
|
-
- Environment variables now properly inherited in `mcp_client.py` (@AbhiTheModder)
|
|
217
|
-
|
|
218
|
-
### v2.6.0 (2026-03-13)
|
|
219
|
-
- **Auto-Discovery Scanner**: New `--auto` flag to automatically find and scan MCP servers from Claude, Cursor, VS Code, Windsurf, etc.
|
|
220
|
-
- **Windows Unicode Fixes**: Comprehensive fix for `UnicodeEncodeError` on Windows consoles.
|
|
221
|
-
- **Pydantic Compatibility**: Resolved `AttributeError` for custom metadata in scan results.
|
|
222
|
-
|
|
223
|
-
### v2.5.0 (2026-03-04)
|
|
224
|
-
- **New Scanners**: `code-execution`, `template-injection`, `rag-poisoning`, `idor`, `info-leak`, `deserialization`
|
|
225
|
-
- **Confirmation Proofs**: Added `mcpsec_cmd_success` execution anchor for command injection
|
|
226
|
-
- **SSRF Expansion**: Support for `file://` protocol and generic fetch success indicators
|
|
227
|
-
- **Robust Parameter Handling**: Automatic dummy argument generation for complex tool schemas
|
|
228
|
-
- **Enhanced Classification**: Massive reduction in false positives for blocked/sandboxed tools
|
|
229
|
-
|
|
230
|
-
### v2.4.0 (2026-02-28)
|
|
231
|
-
- **SAST Rules Expansion**: 87 new Semgrep rules → **149 total** across 24 rule files
|
|
232
|
-
- Broad patterns for command injection, path traversal, SQL injection, SSRF, deserialization
|
|
233
|
-
- Secrets detection: AWS keys, AI API keys, GitHub/Slack tokens, JWT secrets
|
|
234
|
-
- MCP-specific rules: dangerous tool names, empty schemas, error leaks, input reflection
|
|
235
|
-
- Code smells: security TODOs, empty catches, TLS disabled, CORS *, ReDoS patterns
|
|
236
|
-
|
|
237
|
-
### v2.3.0 (2026-02-28)
|
|
238
|
-
- **Scanner Nuclear Expansion**: Command injection (138), path traversal (104), SSRF (81) payloads
|
|
239
|
-
- Encoding bypasses, protocol smuggling, shell-specific evasion
|
|
240
|
-
- 5 new fuzz generators: integer boundaries, concurrency, memory exhaustion, regex DoS, deserialization
|
|
241
|
-
- SDK-specific Semgrep rules for Go, Rust, Python async, .NET
|
|
242
|
-
|
|
243
|
-
### v2.2.0 (2026-02-28)
|
|
244
|
-
- **SARIF 2.1.0 Output** for CI/CD integration
|
|
245
|
-
- CWE mapping and severity scoring
|
|
246
|
-
- Audit report export with `--output` and `--format` flags
|
|
247
|
-
|
|
248
|
-
### v2.1.0 (2026-02-27)
|
|
249
|
-
- **AI Exploitation Assistant**: `select`, `run`, `next`, `verdict`, `auto` REPL commands
|
|
250
|
-
- Expert controls: `edit`, `aggressive`, `hint` for complex bypasses
|
|
251
|
-
- AI learns from manual `call` commands and response history
|
|
252
|
-
|
|
253
|
-
### v2.0.3 (2026-02-26)
|
|
254
|
-
- **MCP Repeater**: Interactive REPL for manual/semi-auto finding validation
|
|
255
|
-
- AI payload engine with context-aware recommendations
|
|
256
|
-
- Exploit playbooks for SQLi, RCE, SSRF, path traversal
|
|
257
|
-
- Automated evidence capture and PoC generation
|
|
258
|
-
|
|
259
|
-
<details>
|
|
260
|
-
<summary>Earlier versions</summary>
|
|
261
|
-
|
|
262
|
-
### v2.0.2 (2026-02-26)
|
|
263
|
-
- Tool chain analysis for dangerous combinations
|
|
264
|
-
- Cross-platform Windows support improvements
|
|
265
|
-
|
|
266
|
-
### v2.0.1 (2026-02-25)
|
|
267
|
-
- Advanced SQL scanner with modular detection
|
|
268
|
-
- DB fingerprinting for MySQL, Postgres, MSSQL, SQLite
|
|
269
|
-
|
|
270
|
-
### v2.0.0 (2026-02-24)
|
|
271
|
-
- Fuzzing engine v2 with chained state-machine exploration
|
|
272
|
-
- AI-powered validation of security findings
|
|
273
|
-
|
|
274
|
-
</details>
|
|
257
|
+
See [CHANGELOG.md](CHANGELOG.md) for the full release history.
|
|
275
258
|
|
|
276
259
|
---
|
|
277
260
|
|
|
@@ -279,7 +262,7 @@ mcpsec fuzz --stdio "server" --output results.sarif
|
|
|
279
262
|
|
|
280
263
|
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
281
264
|
|
|
282
|
-
CI runs automatically on all PRs
|
|
265
|
+
CI runs automatically on all PRs - linting with Ruff and cross-platform tests (Ubuntu, Windows, macOS).
|
|
283
266
|
|
|
284
267
|
---
|
|
285
268
|
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"""AI payload generator — creates targeted exploits per MCP tool."""
|
|
2
2
|
|
|
3
|
+
import logging
|
|
3
4
|
import json
|
|
4
5
|
import re
|
|
5
6
|
from typing import Any, Dict, List
|
|
6
7
|
|
|
7
8
|
from mcpsec.ai.llm_client import LLMClient
|
|
8
9
|
|
|
10
|
+
logger = logging.getLogger(__name__)
|
|
11
|
+
|
|
12
|
+
|
|
9
13
|
PAYLOAD_SYSTEM_PROMPT = """You are a penetration tester generating exploit payloads for MCP
|
|
10
14
|
(Model Context Protocol) server tools. You generate TARGETED payloads, not generic
|
|
11
15
|
fuzz strings. Every payload must have a clear hypothesis about what vulnerability
|
|
@@ -131,9 +135,8 @@ Respond ONLY with JSON array."""
|
|
|
131
135
|
items = json.loads(cleaned)
|
|
132
136
|
if isinstance(items, list):
|
|
133
137
|
return [i for i in items if isinstance(i, dict) and "payload" in i]
|
|
134
|
-
except json.JSONDecodeError:
|
|
135
|
-
|
|
136
|
-
|
|
138
|
+
except json.JSONDecodeError as e:
|
|
139
|
+
logger.debug(f"Exception caught: {e}")
|
|
137
140
|
# Try to find JSON array in the response
|
|
138
141
|
# Handle case where LLM wraps response in explanation text
|
|
139
142
|
bracket_start = cleaned.find("[")
|
|
@@ -145,9 +148,8 @@ Respond ONLY with JSON array."""
|
|
|
145
148
|
items = json.loads(json_str)
|
|
146
149
|
if isinstance(items, list):
|
|
147
150
|
return [i for i in items if isinstance(i, dict) and "payload" in i]
|
|
148
|
-
except json.JSONDecodeError:
|
|
149
|
-
|
|
150
|
-
|
|
151
|
+
except json.JSONDecodeError as e:
|
|
152
|
+
logger.debug(f"Exception caught: {e}")
|
|
151
153
|
# Last resort: try to find individual JSON objects
|
|
152
154
|
# Some LLMs return one object per line
|
|
153
155
|
items = []
|
|
@@ -160,3 +162,5 @@ Respond ONLY with JSON array."""
|
|
|
160
162
|
continue
|
|
161
163
|
|
|
162
164
|
return items
|
|
165
|
+
|
|
166
|
+
|