CVE-2021-41270 CSV Injection in Symfony

Medium 6.5 Published Updated

Attackers can execute arbitrary commands via CSV formula injection if the csv_escape_formulas option is not enabled or configured incorrectly.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2021-41270?

CVE-2021-41270 is a medium-severity vulnerability in Fedoraproject Fedora, published on 24 Nov 2021. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

Symfony/Serializer handles serializing and deserializing data structures for Symfony, a PHP framework for web and console applications and a set of reusable PHP components. Symfony versions 4.1.0 before 4.4.35 and versions 5.0.0 before 5.3.12 are vulnerable to CSV injection, also known as formula injection. In Symfony 4.1, maintainers added the opt-in `csv_escape_formulas` option in the `CsvEncoder`, to prefix all cells starting with `=`, `+`, `-` or `@` with a tab `\t`. Since then, OWASP added 2 chars in that list: Tab (0x09) and Carriage return (0x0D). This makes the previous prefix char (Tab `\t`) part of the vulnerable characters, and OWASP suggests using the single quote `'` for prefixing the value. Starting with versions 4.4.34 and 5.3.12, Symfony now follows the OWASP recommendations and uses the single quote `'` to prefix formulas and add the prefix to cells starting by `\t`, `\r` as well as `=`, `+`, `-` and `@`.

Weakness: CWE-1236

Which versions are affected by CVE-2021-41270?

9 open source packages ship an affected version, including symfony/serializer, symfony and symfony/symfony. It affects 2 products.

PackageAffectedFixed in
symfony/serializer PackagistFrom 4.1.04.4.35
symfony/serializer PackagistFrom 4.1.04.4.35
symfony/serializer PackagistFrom 5.0.05.3.12
symfony/serializer PackagistFrom 5.0.05.3.12
symfony BitnamiFrom 4.1.04.4.35, 5.3.12
symfony/symfony PackagistFrom 4.1.04.4.35
3 more packages
symfony/symfony PackagistFrom 4.1.04.4.35
symfony/symfony PackagistFrom 5.0.05.3.12
symfony/symfony PackagistFrom 5.0.05.3.12

Products include Fedoraproject Fedora, Sensiolabs Symfony.

How do I fix CVE-2021-41270?

Upgrade symfony/serializer to a fixed version for your release line: 4.4.35 or 5.3.12.

Is CVE-2021-41270 being exploited?

There is no known exploitation of CVE-2021-41270 in the wild and no public exploit code.

All Fedoraproject Fedora vulnerabilities

Sources

Also known as BIT-symfony-2021-41270, DEBIAN-CVE-2021-41270, GHSA-2xhg-w2g5-w95x, UBUNTU-CVE-2021-41270.

Is CVE-2021-41270 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free