Which component(s) does this affect?
Problem Statement
Performance Monitor handles SQL Server credentials, executes dynamic SQL, manages local DuckDB databases with parquet files, and spawns external processes. There has not been a formal security review of the codebase to identify potential vulnerabilities across these attack surfaces.
As the project matures and gains adoption, a static code security assessment would help identify and remediate issues before they become risks for users running the tool against production SQL Server instances.
Proposed Solution
Conduct a static code security assessment covering the following areas, roughly in priority order:
1. Credential & Connection String Handling (High Priority)
- Audit how SQL Server credentials are stored, transmitted, and persisted in both Dashboard (in-memory) and Lite (DuckDB) editions
- Verify connection strings use
Encrypt=true / TrustServerCertificate appropriately
- Check for credentials in logs, exception messages, or telemetry output
2. SQL Injection / Dynamic SQL (High Priority)
- Review all parameterized vs. concatenated SQL in collection scripts and application code
- Audit DuckDB query construction in LocalDataService methods
- Check MCP query tools (McpQueryTools.cs) for injection vectors
3. File Path & Process Execution (Medium Priority)
- Audit all
Process.Start call sites for command injection via user-influenced paths
- Review parquet/DuckDB file path construction for path traversal
- Check installer script paths and ScriptProvider for traversal risks
4. Local Data Security (Medium Priority)
- Assess DuckDB file permissions (data at rest)
- Review parquet archive file handling and cleanup
- Check dismissed_archive_alerts sidecar table for data leakage
5. Concurrency & Race Conditions (Medium Priority)
- Review ReaderWriterLockSlim usage for TOCTOU vulnerabilities
- Audit ArchiveService.IsArchiving flag for race conditions
- Check schema migration locking
6. Dependency Supply Chain (Lower Priority)
- Audit NuGet packages for known CVEs at current pinned versions
- Review transitive dependencies
7. Installer Security (Lower Priority)
- Review DependencyInstaller.cs for privilege escalation paths
- Check SQL script execution permissions model
- Audit upgrade script ordering and injection
Use Case
A contributor (assignee) will perform the static code review using automated tooling and manual inspection, filing any findings as separate issues (or via the security reporting process in SECURITY.md for actual vulnerabilities). The goal is a clean bill of health or a prioritized remediation list.
Alternatives Considered
- External pen test engagement -- more thorough (includes runtime, network, and memory analysis) but higher cost. Could follow this initial static review if warranted.
- Automated SAST tooling only -- tools like CodeQL or Semgrep could catch common patterns but miss logic-level issues. Worth running in parallel but not sufficient alone.
Additional Context
- Assessment scope: current
dev branch as of v2.7.0
- Estimated effort: 2-3 days for static code review
- No SQL Server version dependency -- this is a code-level review
- No schema changes required -- this is an audit, not an implementation
- Findings that constitute actual vulnerabilities will be reported privately per SECURITY.md policy, not posted publicly
Which component(s) does this affect?
Problem Statement
Performance Monitor handles SQL Server credentials, executes dynamic SQL, manages local DuckDB databases with parquet files, and spawns external processes. There has not been a formal security review of the codebase to identify potential vulnerabilities across these attack surfaces.
As the project matures and gains adoption, a static code security assessment would help identify and remediate issues before they become risks for users running the tool against production SQL Server instances.
Proposed Solution
Conduct a static code security assessment covering the following areas, roughly in priority order:
1. Credential & Connection String Handling (High Priority)
Encrypt=true/TrustServerCertificateappropriately2. SQL Injection / Dynamic SQL (High Priority)
3. File Path & Process Execution (Medium Priority)
Process.Startcall sites for command injection via user-influenced paths4. Local Data Security (Medium Priority)
5. Concurrency & Race Conditions (Medium Priority)
6. Dependency Supply Chain (Lower Priority)
7. Installer Security (Lower Priority)
Use Case
A contributor (assignee) will perform the static code review using automated tooling and manual inspection, filing any findings as separate issues (or via the security reporting process in SECURITY.md for actual vulnerabilities). The goal is a clean bill of health or a prioritized remediation list.
Alternatives Considered
Additional Context
devbranch as of v2.7.0