This is a hardened fork of CodeGraphContext with additional security measures.
The add_code_to_graph tool now validates paths to prevent:
- Indexing of sensitive files (
.ssh,.env, credentials, etc.) - Path traversal outside allowed directories
- Symlink escape attacks
Configuration:
# Allow specific directories (colon-separated)
export CGC_ALLOWED_ROOTS="/home/user/projects:/home/user/workspace"
# Default: current working directory onlyBlocked patterns:
.ssh,.gnupg,.aws,.kube(credentials).env,.envrc,credentials,secrets*.pem,*.key,id_rsa,id_ed25519/etc/shadow,/etc/passwd
The execute_cypher_query tool now:
- Validates query prefix (MATCH, WITH, RETURN only)
- Blocks write operations (CREATE, MERGE, DELETE, etc.)
- Supports parameterized queries
- Normalizes Unicode to prevent bypass
Parameterized queries (recommended):
# Instead of string interpolation
query = "MATCH (n) WHERE n.name = $name RETURN n"
params = {"name": user_input}
result = execute_cypher_query(db, cypher_query=query, params=params)For security issues in this hardened fork, open an issue with the security label.
For upstream CodeGraphContext security issues, see: https://github.com/CodeGraphContext/CodeGraphContext/security
Full security audit: memory/research/codegraphcontext-security-audit.md
| Severity | Count | Key Findings |
|---|---|---|
| Critical | 0 | — |
| High | 0 | — |
| Medium | 2 | Cypher injection, path traversal (both mitigated) |
| Low | 3 | Credential storage, no auth, bundle injection |
Verdict: Safe for local use with trusted codebases.
Original upstream security policy follows below.
We take security seriously. If you discover a security vulnerability, please report it responsibly.
DO NOT create a public GitHub issue for security vulnerabilities.
Instead, please:
- Email your findings to security@codegraphcontext.dev
- Include a detailed description of the vulnerability
- Provide steps to reproduce if possible
- Allow us 90 days to respond before public disclosure
We provide security updates for the latest major version only.
- The MCP server listens on stdin/stdout only (no network exposure)
- No authentication is required (local process communication)
- Only run the MCP server from trusted parent processes
- Credentials are stored in environment variables or
.envfiles - Never commit credentials to version control
- Use environment-specific credential files
- The indexer can read any file the process has access to
- Only index trusted codebases
- Consider running in a container for untrusted code
- The
execute_cypher_querytool is restricted to read-only operations - Write operations (CREATE, MERGE, DELETE) are blocked
- Custom deployments may need additional restrictions