{"id":"CVE-2021-41270","aliases":["CVE-2021-41270","GHSA-2xhg-w2g5-w95x","BIT-SYMFONY-2021-41270"],"related":[],"kind":"vulnerability","state":"published","title":"CSV Injection in Symfony","summary":"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 `@`.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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 `@`.","source":"cvelist"},{"lang":"en","text":"Description\n-----------\n\nCSV 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.\n\nIn 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`. \n\nSince then, OWASP added 2 chars in that list: \n- Tab (0x09)\n- Carriage return (0x0D)\n\nThis makes our previous prefix char (Tab `\\t`) part of the vulnerable characters, and [OWASP suggests](https://owasp.org/www-community/attacks/CSV_Injection) using the single quote `'` for prefixing the value.\n\nResolution\n----------\n\nSymfony 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 `@`.\n\nThe patch for this issue is available [here](https://github.com/symfony/symfony/commit/3da6f2d45e7536ccb2a26f52fbaf340917e208a8) for branch 4.4.\n\nCredits\n-------\n\nWe would like to thank Jake Barwell for reporting the issue and Jérémy Derussé for fixing the issue.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Symfony/Serializer maneja la serialización y deserialización de estructuras de datos para Symfony, un framework PHP para aplicaciones web y de consola y un conjunto de componentes PHP reusables. Symfony versiones 4.1.0 anteriores a 4.4.35 y versiones 5.0.0 anteriores a 5.3.12, son vulnerables a una inyección de CSV, también se conoce como inyección de fórmulas. En Symfony 4.1, los mantenedores añadieron la opción \"csv_escape_formulas\" en el \"CsvEncoder\", para prefijar todas las celdas que empiezan con \"=\", \"+\", \"-\" o \"@\" con un tabulador \"\\t\". Desde entonces, OWASP ha añadido 2 caracteres en esa lista: Tabulador (0x09) y retorno de Carro (0x0D). Esto hace que el anterior carácter de prefijo (Tab \"\\t\") forme parte de los caracteres vulnerables, y OWASP sugiere usar la comilla simple \"'\" para prefijar el valor. A partir de las versiones 4.4.34 y 5.3.12, Symfony ahora sigue las recomendaciones de OWASP y usa la comilla simple \"'\" para prefijar las fórmulas y añadir el prefijo a las celdas que empiezan por \"\\t\", \"\\r\" así como \"=\", \"+\", \"-\" y \"@\"","source":"nvd"}],"published":"2021-11-24T19:05:11.000Z","modified":"2026-07-08T06:28:50.736Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:S/C:P/I:N/A:N","score":4,"rating":"MEDIUM"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"MEDIUM"}],"cwes":["CWE-1236"],"affected":[{"ranges":[{"version":">= 4.1.0, < 4.4.35","status":"affected"},{"version":">= 5.0.0, < 5.3.12","status":"affected"}],"vendor":"symfony","product":"symfony","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"5.0.0","status":"affected","fixed":"5.3.12"}],"ecosystem":"Packagist","package":"symfony/serializer","purl":"pkg:composer/symfony/serializer","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"4.1.0","status":"affected","fixed":"4.4.35"}],"ecosystem":"Packagist","package":"symfony/serializer","purl":"pkg:composer/symfony/serializer","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"4.1.0","status":"affected","fixed":"4.4.35"}],"ecosystem":"Packagist","package":"symfony/symfony","purl":"pkg:composer/symfony/symfony","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"5.0.0","status":"affected","fixed":"5.3.12"}],"ecosystem":"Packagist","package":"symfony/symfony","purl":"pkg:composer/symfony/symfony","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"4.1.0","fixed":"4.4.35"},{"status":"affected","introduced":"5.0.0","fixed":"5.3.12"}],"vendor":"sensiolabs","product":"symfony","cpe":"cpe:2.3:a:sensiolabs:symfony:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"34"},{"status":"affected","version":"35"}],"vendor":"fedoraproject","product":"fedora","cpe":"cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"semver","introduced":"4.1.0","status":"affected","fixed":"4.4.35"},{"type":"semver","introduced":"5.0.0","status":"affected","fixed":"5.3.12"}],"ecosystem":"Bitnami","package":"symfony","purl":"pkg:bitnami/symfony","source":"bitnami"}],"references":[{"url":"https://github.com/symfony/symfony/pull/44243","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://github.com/symfony/symfony/releases/tag/v5.3.12","tags":["release-notes","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://github.com/symfony/symfony/security/advisories/GHSA-2xhg-w2g5-w95x","tags":["patch","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://github.com/symfony/symfony/commit/3da6f2d45e7536ccb2a26f52fbaf340917e208a8","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/QSREFD2TJT5LWKM6S4MD3W26NQQ5WJUP/","tags":["vendor-advisory","web","x-refsource-fedora","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3BPT4SF6SIXFMZARDWED5T32J7JEH3EP/","tags":["vendor-advisory","web","x-refsource-fedora","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-41270","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/serializer/CVE-2021-41270.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2021-41270.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/symfony/symfony","tags":["package"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3BPT4SF6SIXFMZARDWED5T32J7JEH3EP","tags":["web"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/QSREFD2TJT5LWKM6S4MD3W26NQQ5WJUP","tags":["web"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/3BPT4SF6SIXFMZARDWED5T32J7JEH3EP","tags":["web"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QSREFD2TJT5LWKM6S4MD3W26NQQ5WJUP","tags":["web"],"sources":["ghsa"]},{"url":"https://symfony.com/cve-2021-41270","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-41270","url":"https://www.cve.org/CVERecord?id=CVE-2021-41270","licence":"CVE Terms of Use","modified":"2024-08-04T03:08:31.658Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-2xhg-w2g5-w95x","url":"https://github.com/advisories/GHSA-2xhg-w2g5-w95x","licence":"CC-BY-4.0","modified":"2026-07-08T06:28:50.736Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-41270","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-41270","licence":"Public domain","modified":"2026-06-17T04:08:12.617Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-SYMFONY-2021-41270","url":"https://osv.dev/vulnerability/BIT-SYMFONY-2021-41270","licence":"Apache-2.0","modified":"2024-03-06T11:25:28.861Z"}],"updatedAt":"2026-11-25T22:58:05.758Z","epss":{"score":0.014,"percentile":0.73285,"date":"2026-12-01T12:00:22.000Z"}}