Skip to content

Attack Surface & Threat Matrix

DevDiff is designed as a local-first developer security tool. Because developer tools operate directly on engineer workstations with access to source code and environment credentials, minimizing the software attack surface is a primary design goal.


Threat Profile & Mitigation Matrix


Attack Surfaces & Defensive Mitigations

1. File System Access Surface

  • Threat Vector: Malicious workspace configuration files (.devdiff/config.json or .cursorrules) referencing system files outside the repository.
  • Impact: Unauthorized reading of SSH keys, cloud credentials, or sensitive files (/etc/passwd, ~/.aws/credentials).
  • Mitigation: InjectionGuardV2.validateFilePath enforces strict path normalization and workspace boundary checks.

2. Process Execution & Subprocess Surface

  • Threat Vector: Malicious branch names, git tag names, or file names containing shell commands executed via git subcommands.
  • Impact: Arbitrary command execution with developer privileges.
  • Mitigation: Subprocesses are spawned directly without shell context (shell: false), bypassing shell syntax parsing.

3. Local Webview & IPC Surface

  • Threat Vector: VS Code webview panel receiving untrusted Markdown changelogs or Mermaid diagrams.
  • Impact: Cross-Site Scripting (XSS) or local IPC message spoofing.
  • Mitigation: VS Code webview panels enforce strict Content Security Policy (CSP) headers allowing script execution only from nonced sources.

4. Local Gateway Network Binding Surface

  • Threat Vector: External devices on the local local network (LAN) connecting to DevDiff HTTP/MCP ports (3737, 3740).
  • Impact: Unauthorized remote querying of codebase memory index.
  • Mitigation: Network interfaces strictly bind to loopback (127.0.0.1 / ::1) by default. External network binding requires explicit CLI authorization (--host 0.0.0.0).

5. AI Provider Integration Surface

  • Threat Vector: Unsanitized code diffs containing API keys or PII sent to third-party AI APIs.
  • Impact: Credential leakage to cloud AI logs or model training sets.
  • Mitigation: RedactionEngineV2 redacts keys before payloads leave the workstation.

Security Vulnerability Classification

Threat VectorCVSS v3 Base ScoreSeverity RatingMitigation Mechanism
Command Injection8.8 (High)CRITICALSubprocess argument array passing (shell: false)
Out-of-Bound File Access7.5 (High)HIGHvalidateFilePath workspace jail
Network Eavesdropping7.4 (High)HIGHLoopback binding (127.0.0.1)
Secret Leakage7.2 (High)HIGHRedactionEngineV2 automatic masking
Prompt Injection5.3 (Medium)MEDIUMPromptSanitizer Unicode Tag block stripping
Webview XSS4.7 (Medium)MEDIUMVS Code Webview CSP & HTML Sanitization