# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.3.0] - 2026-03-18

### Added
- Enhanced Auto-Fix Engine (`mcpaudit/fixer.py`):
  - Auto-fix coverage expanded from 5 rules to 18 rules
  - SEC-001: hardcoded secrets -> os.environ.get()
  - CMD-001: shell=True -> shell=False
  - CMD-002: os.system/dynamic args -> subprocess.run with args list
  - PATH-001: path traversal -> resolve() + is_relative_to() check
  - SQL-001: string SQL -> parameterized query
  - DESER-001: pickle/yaml.load -> json.loads/yaml.safe_load
  - ERR-001: missing error handling -> try/except wrapper
  - SSRF-001: unvalidated URL -> URL allowlist check
  - LOG-001: sensitive logging -> redaction placeholder
  - FILE-001: unsafe file ops -> path validation with realpath
  - MCP-005: no input validation -> isinstance check
  - MCP-006: no response limit -> [:MAX_SIZE] truncation
  - CRYPTO-001: weak hash (MD5/SHA1) -> SHA256 (NEW RULE)
  - RES-001: no timeout -> timeout=30 parameter
  - AUTH-001: no auth check -> auth validation stub
  - VAL-001: no validation -> isinstance check stub
  - PERM-001: chmod 777 -> chmod 755
  - INFO-001: verbose errors -> generic error message
  - `FixStats` dataclass with coverage/success metrics
  - `compute_fix_stats()` for statistics aggregation
  - `format_fix_stats()` for human-readable stats output
  - `get_fixable_rule_ids()` utility function
  - CLI: `--fix-stats` flag to show auto-fix coverage after scan
- Compliance Profiles (`mcpaudit/profiles.py`):
  - `strict`: All rules, severity >= LOW, fail on any finding
  - `standard`: Production rules, severity >= MEDIUM, fail on 3+
  - `ci`: Fast scan, severity >= HIGH, JSON output, fail on any
  - `development`: Relaxed, severity >= HIGH, MCP rules disabled
  - `owasp-agentic`: Only OWASP Agentic Top 10 related rules
  - `mcp-only`: Only MCP protocol-specific rules (MCP-001 through MCP-019)
  - CLI: `mcpaudit scan <path> --profile strict|standard|ci|development|owasp-agentic|mcp-only`
  - CLI: `--list-profiles` to display all available profiles
  - Profile controls: enabled_rules, min_severity, fail_threshold, output_format
  - Profile severity filtering applied after scan
  - Profile fail threshold check for CI/CD gates
- CRYPTO-001: Weak Cryptographic Hash rule (`mcpaudit/rules/weak_crypto.py`):
  - Detects MD5, SHA1, HMAC-MD5, HMAC-SHA1 usage (CWE-328)
  - Auto-fix: replaces hashlib.md5/sha1 with hashlib.sha256
  - Severity: MEDIUM, with detailed description and remediation
- 131 new tests (1768 total, was 1637)

### Changed
- Version bumped to 1.3.0
- Total rules: 43 Python (was 42) + 15 TS + 30 generated + 15 MCP protocol
- Auto-fix coverage: 18 rules with suggest_fix() (was 5)

## [1.2.0] - 2026-03-18

### Added
- MCP Protocol-Specific Security Rules (`mcpaudit/rules/mcp_rules.py`):
  - MCP-005: Tool handler missing input validation (CWE-20, HIGH)
  - MCP-006: Tool response size not limited (CWE-770, MEDIUM)
  - MCP-007: Server lacks authentication check (CWE-306, CRITICAL)
  - MCP-008: Resource listing unrestricted (CWE-284, MEDIUM)
  - MCP-009: Server exposes internal paths (CWE-200, MEDIUM)
  - MCP-010: Tool name collision with system tools (CWE-441, HIGH)
  - MCP-011: Missing transport encryption (CWE-319, HIGH)
  - MCP-012: Server version disclosure (CWE-200, LOW)
  - MCP-013: Tool schema missing required fields (CWE-1059, MEDIUM)
  - MCP-014: Notification handler accepts arbitrary data (CWE-20, HIGH)
  - MCP-015: Server accepts unauthenticated connections (CWE-306, CRITICAL)
  - MCP-016: Tool call logging insufficient (CWE-778, LOW)
  - MCP-017: Server-sent events without origin check (CWE-346, HIGH)
  - MCP-018: Batch tool calls without rate limit (CWE-770, MEDIUM)
  - MCP-019: Config hot-reload without validation (CWE-94, HIGH)
  - Total MCP-specific rules: 19 (was 4)
- Scan Summary Dashboard (`mcpaudit/summary_dashboard.py`):
  - `generate_dashboard(summary)` -- self-contained HTML dashboard
  - Executive summary with risk score (0-100)
  - Findings by severity (CSS conic-gradient pie chart)
  - Findings by category (CSS bar chart)
  - Timeline if scan history available
  - Top 5 most common findings
  - Remediation priority queue sorted by severity
  - CLI: `mcpaudit scan <path> --dashboard output.html`
  - Zero external dependencies -- pure inline CSS
- 162 new tests (1458 total, was 1296)

### Changed
- Version bumped to 1.2.0
- Total rules: 102+ (42 Python + 15 TS + 30 generated + 15 MCP protocol)

## [1.1.0] - 2026-03-18

### Added
- Rule Generation Engine (`mcpaudit/rule_generator.py`):
  - `RuleTemplate` class with regex pattern, severity, CWE, fix suggestion
  - `generate_rules_from_cve()` -- create rules from CVE pattern definitions
  - `generate_rules_from_owasp()` -- OWASP Agentic Top 10-specific rules
  - Built-in catalog of 30 new rule templates across 6 categories
  - CLI: `mcpaudit generate --category <cat>` to list templates
  - Total rules: 72+ (27 Python + 15 TS + 30 generated)
- MCP Server Fingerprinting (`mcpaudit/fingerprint.py`):
  - `fingerprint_server(source_code)` -- detect FastMCP, mcp-python-sdk, TS SDK
  - `fingerprint_path()` -- extended fingerprint with transport/tools/resources
  - Known vulnerability database per framework
  - CLI: `mcpaudit fingerprint <path>` with `--extended`
- Fleet HTML Executive Report (`mcpaudit/fleet_report.py`):
  - `generate_fleet_report(scan_results)` -- self-contained HTML
  - Executive Summary, Risk Heatmap, Per-Server Detail, Trend, Recommendations
  - CLI: `mcpaudit scan-all <dir> --fleet-report output.html`
- 171 new tests (1296 total, was 1125)

### Changed
- Version bumped to 1.1.0

## [0.5.0] - 2026-03-17

### Added
- Scan history and trend tracking:
  - `--save-history` flag to persist scan results as JSON
  - `--history` flag to view past scan results and trends
  - `--history-dashboard FILE` generates HTML dashboard from scan history
  - `--history-dir` and `--history-label` for custom history management
- SARIF 2.1.0 output format (`--format sarif`):
  - Compatible with GitHub Code Scanning, VS Code SARIF Viewer
  - Full OASIS SARIF 2.1.0 spec compliance
- TypeScript/JavaScript scanning (12 new rules, 36 total):
  - TS-CMD-001: Command injection
  - TS-SQL-001: SQL injection
  - TS-PATH-001: Path traversal
  - TS-SEC-001: Hardcoded secrets
  - TS-INPUT-001: Missing input validation
  - TS-AUTH-001: Missing authentication
  - TS-SSRF-001: Server-Side Request Forgery
  - TS-DESER-001: Unsafe deserialization
  - TS-RATE-001: Missing rate limiting
  - TS-INFO-001: Information disclosure
  - TS-PROMPT-001: Prompt injection
  - TS-PERM-001: Excessive permissions
- `--explain RULE_ID` flag for detailed rule documentation
- `--exclude RULE_IDS` to skip specific rules
- PyPI-ready packaging with pyproject.toml

### Changed
- Version bumped to 0.5.0
- 36 security rules total (24 Python + 12 TypeScript/JavaScript)

## [0.4.0] - 2026-03-17

### Added
- SAFE-MCP Threat Taxonomy module (`mcpaudit/taxonomy.py`):
  - 8 standardized threat categories with MITRE ATT&CK references
  - All 24 rules mapped to threat categories
  - `--taxonomy` CLI flag for grouped threat view
- MCP-003: Confused Deputy Attack detection (CWE-441, CRITICAL)
  - Detects tool handlers passing user input to privileged operations
  - Checks file I/O, network requests, subprocess without auth
- MCP-004: Prompt Injection Vector detection (CWE-74, HIGH)
  - Detects dynamic strings in tool decorator descriptions
  - Detects user input concatenated into LLM prompt calls
- Auto-remediation suggestions:
  - `remediation` field added to Finding model
  - `--remediation` CLI flag to display fix guidance
  - New rules (MCP-003, MCP-004) include remediation guidance
- 69 new tests (278 total):
  - test_taxonomy.py (27 tests)
  - test_confused_deputy.py (15 tests)
  - test_prompt_injection.py (16 tests)
  - test_remediation.py (11 tests)

### Changed
- Version bumped to 0.4.0
- 24 security rules (was 22)

## [0.3.0] - 2026-03-17

### Added
- 7 new security rules (22 total):
  - SSRF-001: Server-Side Request Forgery (CWE-918)
  - FILE-001: Unsafe File Write with dynamic paths (CWE-73)
  - ERR-001: Missing error handling in tool handlers (CWE-755)
  - LOG-001: Sensitive data in log statements (CWE-532)
  - RES-001: Unbounded resource consumption (CWE-400)
  - MCP-001: MCP tool handler missing docstring (CWE-1059)
  - MCP-002: Direct environment access in tool handler (CWE-526)
- Baseline management for CI/CD (`--create-baseline`, `--baseline`)
- `--list-rules` flag to display all available rules
- `--quiet` flag for CI/CD (exit code only, no output on clean scan)
- `examples/vulnerable_server.py` demo file (26 findings, Grade F)
- CWE references on all 22 rules (was 9)

### Changed
- Output standardized to English
- Version bumped to 0.3.0
- 195 tests (was 132)

## [0.2.0] - 2026-03-17

### Added
- Confidence scoring for all findings (HIGH/MEDIUM/LOW)
- Configuration file support (`.mcpaudit.yml`)
- Type hints across all modules
- Rule enable/disable via config
- `--init` CLI command to generate default config
- `--config` CLI flag to specify config file path
- Path exclusion via config (`exclude_paths`)
- Severity threshold via config (`severity_threshold`)

### Changed
- Findings now include confidence level in all output formats
- HTML report shows confidence badges alongside severity
- Text output shows confidence tag per finding
- Version bumped to 0.2.0

## [0.1.0] - 2026-03-15

### Added
- Initial release with 15 security rules
- AST-based Python analysis
- CLI with text, JSON, and HTML output formats
- Pre-commit hook
- GitHub Actions workflow
- 84 comprehensive tests
