Advisory

GHSA-2xhg-w2g5-w95x

Also known as: BIT-symfony-2021-41270, CVE-2021-41270

Summary

CSV Injection in symfony/serializer

Details

Description
-----------

CSV Injection, also known as Formula Injection, occurs when websites embed untrusted input inside CSV files. When a spreadsheet program opens a CSV, any cell starting with = is interpreted by the software as a formula and could be abused by an attacker.

In Symfony 4.1, we've added the opt-in csv_escape_formulas option in CsvEncoder, to prefix all cells starting by =, +, - or @ by a tab \t.

Since then, OWASP added 2 chars in that list:

  • Tab (0x09)
  • Carriage return (0x0D)

This makes our previous prefix char (Tab \t) part of the vulnerable characters, and OWASP suggests using the single quote ' for prefixing the value.

Resolution
----------

Symfony now follows the OWASP recommendations and use the single quote ' to prefix formulas and adds the prefix to cells starting by \t, \r as well as =, +, - and @.

The patch for this issue is available here for branch 4.4.

Credits
-------

We would like to thank Jake Barwell for reporting the issue and Jérémy Derussé for fixing the issue.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2021-11-24 21:01 UTC
Modified
2026-07-08 06:28 UTC

Affected packages and fixes

symfony/serializer

Packagist · All systems

Affected

  • introduced 5.0.0, fixed 5.3.12 (ecosystem)

Fixed versions

5.3.12

Fix

The export has no generic command for this ecosystem.

symfony/serializer

Packagist · All systems

Affected

  • introduced 4.1.0, fixed 4.4.35 (ecosystem)

Fixed versions

4.4.35

Fix

The export has no generic command for this ecosystem.

symfony/symfony

Packagist · All systems

Affected

  • introduced 4.1.0, fixed 4.4.35 (ecosystem)

Fixed versions

4.4.35

Fix

The export has no generic command for this ecosystem.

symfony/symfony

Packagist · All systems

Affected

  • introduced 5.0.0, fixed 5.3.12 (ecosystem)

Fixed versions

5.3.12

Fix

The export has no generic command for this ecosystem.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences