Skip to content

fix(security): harden the CSV formula guard against leading whitespace - #52

Merged
Drago37 merged 1 commit into
developfrom
security/harden-csv-guard
Sep 22, 2026
Merged

Drago37 merged 1 commit into
developfrom
security/harden-csv-guard

Conversation

@Drago37

@Drago37 Drago37 commented Sep 22, 2026

Copy link
Copy Markdown
Owner

Hardens Shared\Domain\CsvFormulaGuard: cells starting with a tab, CR or newline are now neutralised too (OWASP CSV-injection guidance), in addition to = + - @. Both dashboard CSV exports benefit automatically. Behaviour change is limited to those leading-whitespace inputs (now prefixed with a quote). Tests updated.

Shared\Domain\CsvFormulaGuard now also neutralises cells that begin with
a tab, carriage return or newline (OWASP CSV-injection guidance), on top
of the existing = + - @ formula leads. A spreadsheet can otherwise glue
such a cell to its neighbour and reinterpret it. Both dashboard CSV
exports (Recettes, Journal d'activité) benefit automatically.

Behaviour change limited to those leading-whitespace inputs, which are
now prefixed with a quote to force plain text.

Gates green: CS-Fixer, PHPStan (max), PHPUnit.
@Drago37 Drago37 added the bug Something isn't working label Sep 22, 2026
@Drago37 Drago37 self-assigned this Sep 22, 2026
@Drago37
Drago37 merged commit 964a5a5 into develop Sep 22, 2026
6 checks passed
@Drago37
Drago37 deleted the security/harden-csv-guard branch September 22, 2026 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant