fix: prevent CSV injection by escaping formula characters (Closes #174) #185

Merged
shahondin1624 merged 1 commits from feature/issue-174-csv-injection-prevention into main 2026-04-10 16:27:40 +02:00
Owner

Summary

  • Adds CsvExportService::sanitizeCsvField() that prefixes fields starting with =, +, -, @ with a single quote
  • Prevents DDE/macro injection when CSV files are opened in Excel
  • Applied in both CsvExportService and EntityExportService

Test plan

  • 7 new unit tests for sanitizeCsvField
  • All 1019 tests pass
  • Normal text, empty strings, and numbers are unaffected

Closes #174

## Summary - Adds `CsvExportService::sanitizeCsvField()` that prefixes fields starting with `=`, `+`, `-`, `@` with a single quote - Prevents DDE/macro injection when CSV files are opened in Excel - Applied in both `CsvExportService` and `EntityExportService` ## Test plan - [x] 7 new unit tests for sanitizeCsvField - [x] All 1019 tests pass - [x] Normal text, empty strings, and numbers are unaffected Closes #174
shahondin1624 added 1 commit 2026-04-10 16:27:35 +02:00
Adds CsvExportService::sanitizeCsvField() that prefixes fields starting
with =, +, -, @ with a single quote to prevent DDE/macro injection in
spreadsheet applications. Applied in both CsvExportService and
EntityExportService. Includes 7 unit tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
shahondin1624 merged commit 21b025af87 into main 2026-04-10 16:27:40 +02:00
shahondin1624 deleted branch feature/issue-174-csv-injection-prevention 2026-04-10 16:27:40 +02:00
Sign in to join this conversation.