Threat model
What ShorSighted touches, who could attack it, and what stops them. Reviewed for each minor release and for any change to a collector, the MCP server or a workflow.
Actors and assets
| Actor | Trust | Can influence |
|---|---|---|
| User running the CLI | Trusted | Targets, flags, shorsighted.yaml, which credentials are in scope |
| Scanned endpoint (TLS/SSH server, DNS) | Untrusted | Every byte of ServerHello, certificates, SSH KEXINIT, STARTTLS banners, DNS answers |
| Cloud provider APIs (AWS, Azure, GCP) | Trusted transport, untrusted content | Resource names, hostnames and settings returned by Describe/List/Get |
| MCP client configs on disk | Untrusted content | Server URLs, headers, env values (may hold secrets) |
AI agent calling serve-mcp | Untrusted | Target lists and options passed to the scan tool |
| Contributor | Untrusted until reviewed | Pull requests |
| GitHub Actions, PyPI | Trusted infrastructure | Builds and distributes releases |
Assets: the user’s cloud credentials and MCP secrets, the user’s network position (ShorSighted can open connections from it), the correctness of the report, and the integrity of published releases.
Attack surface and mitigations
| Threat | Entry point | Mitigation |
|---|---|---|
| Malformed or hostile handshake crashes or hangs the scan | probe/parser.py, probe/ssh.py, probe/chain.py | Bounded reads (MAX_READ), per-step deadlines, parsers fuzzed with Hypothesis; a bad target becomes an error result, never an exception that stops the batch |
| Server lies to get a false “post-quantum” pass | KEX probe | Verdicts need a well-formed TLS 1.3 ServerHello naming the group; ambiguous answers are inconclusive, never pass; the daily differential run compares every verdict with OpenSSL and OpenSSH |
| TLS-inspecting proxy reports its own crypto as the server’s | Chain fetch | probe/interception.py recognizes known interceptors and reports the target as not measured |
| Scan modifies cloud resources | sources/aws/, sources/cloud/ | AWS client guard allows only Describe/List/Get at runtime; Azure and GCP go through a GET-only client; tests check every call against docs/iam-policy.json |
| Cloud bearer token sent to another host | sources/cloud/http.py | Redirects are never followed, so a token only goes to the URL the collector built |
| Secrets from MCP configs leak into reports or logs | sources/mcp.py | Values are reduced to scheme, host and port before storage; the only request is one GET of the OAuth metadata URL per origin |
Agent uses serve-mcp to scan internal networks (SSRF) | mcp_server.py | ScanPolicy resolves names the way the probe does and refuses private, loopback, link-local and metadata addresses unless allowed; per-call target limits |
| Untrusted text injected into HTML/Markdown/SARIF reports | report/ | All server-supplied strings are escaped by the reporter for its format; snapshot tests cover each format |
| Malicious pull request steals CI secrets | .github/workflows/ | pull_request trigger only, read-only default token, no secrets on PR jobs, pinned action SHAs, CodeQL for Actions |
| Compromised dependency | pyproject.toml | Few runtime dependencies, dependency review on every PR, Dependabot, pip-audit before release |
| Tampered release | PyPI, GitHub Releases | Trusted Publishing (no stored token), maintainer approval on the pypi environment, Sigstore signatures, SLSA Build L3 provenance, PEP 740 attestations |
Out of scope
Vulnerabilities in the endpoints being scanned are ShorSighted’s output, not
threats to it. A user who runs it with over-privileged cloud credentials
still gets read-only calls, but should use the policy in
docs/iam-policy.json.