160-tool MCP server for real-time global intelligence from free public APIs: markets, liquidity, prediction markets, SEC filings, conflict, military, aircraft-cohort early warning, migration and border flows, cyber, climate, news and more. Dated observation history, 29 research prompts, cited briefs, geofences, SSE dashboard. MIT, no paid API keys.
Python ai-toolsai-watchanthropicclaudecybersecuritydashboardgeofencinggeopoliticalgeospatialintelligencemarketsmcpmigrationmilitarymodel-context-protocolnuclearosintreal-timespace-weatherthreat-intelligence
Security: SECURITY.md threat model + owner-only cache permissions (issue #21)
Phoenix Agent (Marcs-Mac-Studio)bcc44f2b624f
diff --git a/SECURITY.md b/SECURITY.mdnew file mode 100644index 0000000..2758f17--- /dev/null+++ b/SECURITY.md@@ -0,0 +1,80 @@+# Security Policy++## Reporting a vulnerability++Open a GitHub issue with the label `security`, or email the address on+the maintainer's GitHub profile if the details should stay private+until fixed. Reports that include a runnable reproduction get fixed+fastest. Please state the attacker position your finding assumes (see+the threat model below): a report whose precondition is already+arbitrary local write access to the user's files will be assessed+against that boundary.++## Threat model++world-intel-mcp is a single-user, local tool. It runs as an MCP stdio+server, a CLI, a local dashboard, or a local collector daemon, under+one user account, on that user's machine. It aggregates free public+OSINT feeds. Its trust boundaries:++1. **Upstream data is untrusted and unauthenticated by design.** The+ server aggregates public APIs and RSS feeds (USGS, GDELT, adsb.lol,+ NASA FIRMS, and about 115 others). None of these are signed. The+ server preserves provenance (`source` labels, per-feed propaganda+ risk tiers, `_stale` markers, `data_gaps`, `cited` flags) so a+ consumer can judge the data; it cannot make public data+ trustworthy. Analysis outputs are derived from these inputs and+ inherit their trust level. Treat every output as open-source+ intelligence, not as verified ground truth.++2. **The local machine is inside the trust boundary.** The SQLite+ cache, the AOI store, and the optional Qdrant vector store live on+ the user's own machine and are trusted by the process that wrote+ them. An attacker who can already write the user's files or reach+ the user's local services can feed the server false data; that same+ position also allows patching this package's code, so in-database+ integrity signing would not remove the attack, only relocate it.+ Hardening applied at this boundary: the cache database is created+ with owner-only permissions (0600), all SQL is parameterized, and+ the codebase contains no shell execution, no `eval`/`exec`, and no+ deserialization of non-JSON formats.++3. **MCP tool arguments are untrusted input.** Arguments are validated+ (ranges, types) where they parameterize queries, are never+ interpolated into SQL (parameterized statements only), never reach+ a shell (no subprocess usage exists in the package), and never+ select filesystem paths (report output paths are server-generated,+ not caller-supplied).++4. **Optional local services are the operator's responsibility.**+ Qdrant (vector search) and Ollama (brief generation) are reached at+ `localhost` URLs. Bind them to loopback, as their defaults do; if+ you expose them on a network, that exposure is outside this+ project's control. Do not point `OLLAMA_API_URL` at an untrusted+ host: its responses are rendered in briefs.++5. **Stale data is a feature with a marker, not a hidden fallback.**+ When an upstream fails, the fetcher may serve expired cache entries+ so dashboards do not go blank. Such responses carry `_stale: true`,+ and circuit-breaker state is visible via `intel_status`. Consumers+ that must not act on stale data must check the marker.++## Supported versions++Only the latest release receives fixes.++## Out of scope++- Findings that assume arbitrary local file write, code execution, or+ root on the user's machine (boundary 2 above).+- The authenticity of upstream public OSINT data (boundary 1).+- The network exposure of separately installed services (boundary 4).++## Gaps / not covered++- No cryptographic integrity protection on the cache or vector store;+ see boundary 2 for why that is not the chosen control.+- Dependency supply chain is managed by pinning and review, not by+ vendoring; `pip install` trust applies.+- The dashboard binds locally and has no authentication; do not+ reverse-proxy it to an untrusted network.diff --git a/src/world_intel_mcp/cache.py b/src/world_intel_mcp/cache.pyindex 2ff9e90..fdf1dae 100644--- a/src/world_intel_mcp/cache.py+++ b/src/world_intel_mcp/cache.py@@ -64,6 +64,15 @@ class Cache:"CREATE INDEX IF NOT EXISTS idx_cache_expires ON cache(expires_at)")conn.commit()+ # Owner-only permissions: the cache is trusted-by-design (whatever+ # is in it gets served as intelligence, including to AOI briefs),+ # so keep other local users from writing — or reading — it. The+ # -wal/-shm sidecars inherit the db file's mode. Best-effort:+ # non-POSIX filesystems may refuse.+ try:+ os.chmod(self.db_path, 0o600)+ except OSError:+ logger.debug("Could not chmod cache db at %s", self.db_path)def _get_conn(self) -> sqlite3.Connection:if self._conn is None:diff --git a/src/world_intel_mcp/tests/test_cache.py b/src/world_intel_mcp/tests/test_cache.pyindex c155e8c..d3c6566 100644--- a/src/world_intel_mcp/tests/test_cache.py+++ b/src/world_intel_mcp/tests/test_cache.py@@ -97,3 +97,16 @@ def test_default_path_falls_back_when_unavailable(assert cache.get("fallback") == "ok"finally:cache.close()+++def test_cache_db_file_is_owner_only(tmp_path: Path) -> None:+ """Issue #21 hardening: whatever sits in the cache gets served as+ intelligence (stale fallback included), so the file must not be+ writable — or readable — by other local users."""+ db = tmp_path / "perms" / "cache.db"+ cache = Cache(db)+ try:+ mode = db.stat().st_mode & 0o777+ assert mode == 0o600+ finally:+ cache.close()