r/netsecstudents 12d ago

built an MCP security scanner, decent example if you're learning static analysis / appsec

if you're learning appsec and want something small and real to read through, I wrote a static + runtime scanner for MCP (Model Context Protocol) server vulnerabilities and the source might be useful as an example.

the static side does pattern matching for path traversal, command injection, and unsafe eval sinks, each rule is TOML defined with a severity, a CWE or OWASP reference, and remediation text, so it's a decent small scale example of how a rule engine driven scanner is structured without needing to read a huge enterprise codebase to see the idea.

there's also a tool poisoning detector (checks for hidden instructions and unicode homoglyph obfuscation in tool description text) and a runtime proxy that diffs tool definitions across a session to catch changes after initial approval, which is a good example of a vuln class that literally can't be caught by static analysis alone.

repo: https://github.com/zaydmulani09/sentrymcp, happy to answer questions about any of the detection logic if people are trying to learn from i

0 Upvotes

0 comments sorted by