Exécuter une analyse statique (SAST) sur le code source à la recherche du motif non sécurisé dans le flux de données.
Improper Neutralization of Formula Elements in a CSV File
This vulnerability occurs when an application writes user-supplied data into a CSV file without properly sanitizing special characters. Spreadsheet programs like Excel or Google Sheets interpret…
What is CWE-1236?
Real-world CVEs caused by CWE-1236
-
Low privileged user can trigger CSV injection through a contact form field value
-
Cloud management product allows arbitrary command execution via CSV injection
-
CSV injection in content management system via formula code in a first or last name
Parcours de l'attaquant étape par étape
- 1
Identifier un chemin de code qui traite des entrées non fiables sans validation.
- 2
Élaborer une charge utile qui exploite le comportement non sécurisé — injection, traversal, débordement ou abus de logique.
- 3
Délivrer la charge utile via une requête normale et observer la réaction de l'application.
- 4
Itérer jusqu'à ce que la réponse divulgue des données, exécute le code de l'attaquant ou élève les privilèges.
Vulnerable Other
Hyperlinks or other commands can be executed when a cell begins with the formula identifier, '='
=HYPERLINK(link_location, [friendly_name]) Hyperlinks or other commands can be executed when a cell begins with the formula identifier, '='
=HYPERLINK(link_location, [friendly_name]) Secure Other
Stripping the leading equals sign, or simply not executing formulas from untrusted sources, impedes malicious activity.
HYPERLINK(link_location, [friendly_name]) How to prevent CWE-1236
- Implementation When generating CSV output, ensure that formula-sensitive metacharacters are effectively escaped or removed from all data before storage in the resultant CSV. Risky characters include '=' (equal), '+' (plus), '-' (minus), and '@' (at).
- Implementation If a field starts with a formula character, prepend it with a ' (single apostrophe), which prevents Excel from executing the formula.
- Architecture and Design Certain implementations of spreadsheet software might disallow formulas from executing if the file is untrusted, or if the file is not authored by the current user.
How to detect CWE-1236
Exécuter des tests de sécurité applicative dynamique (DAST) contre le point de terminaison en ligne.
Surveiller les journaux runtime pour détecter des traces d'exception inhabituelles, des entrées malformées ou des tentatives de contournement d'autorisation.
Revue de code : signaler tout nouveau code qui traite les entrées de cette surface sans utiliser les helpers du framework validés.
Plexicus détecte automatiquement CWE-1236 et ouvre une PR de correction en moins de 60 secondes.
Codex Remedium analyse chaque commit, identifie cette faiblesse précise et livre une pull request prête à être relue avec le correctif. Pas de tickets. Pas de transferts.
Frequently asked questions
Qu'est-ce que CWE-1236 ?
This vulnerability occurs when an application writes user-supplied data into a CSV file without properly sanitizing special characters. Spreadsheet programs like Excel or Google Sheets interpret entries starting with '=' as executable formulas, which can lead to malicious command execution when the file is opened.
Quelle est la gravité de CWE-1236 ?
MITRE n'a pas publié de note de probabilité d'exploitation pour cette faiblesse. Traitez-la comme un impact moyen jusqu'à ce que votre modèle de menace prouve le contraire.
Quels langages ou plateformes sont affectés par CWE-1236 ?
MITRE lists the following affected platforms: Not OS-Specific, Not Architecture-Specific, Other.
Comment puis-je prévenir CWE-1236 ?
When generating CSV output, ensure that formula-sensitive metacharacters are effectively escaped or removed from all data before storage in the resultant CSV. Risky characters include '=' (equal), '+' (plus), '-' (minus), and '@' (at). If a field starts with a formula character, prepend it with a ' (single apostrophe), which prevents Excel from executing the formula.
Comment Plexicus détecte et corrige CWE-1236 ?
Le moteur SAST de Plexicus reconnaît la signature de flux de données de CWE-1236 à chaque commit. Lorsqu'une correspondance est trouvée, notre agent Codex Remedium ouvre une PR de correction avec le code corrigé, les tests et un résumé d'une ligne pour le relecteur.
Où puis-je en savoir plus sur CWE-1236 ?
MITRE publie la définition canonique à https://cwe.mitre.org/data/definitions/1236.html. Vous pouvez également consulter la documentation OWASP et NIST pour des conseils adjacents.
Weaknesses related to CWE-1236
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
This vulnerability occurs when an application uses untrusted external input to build a command, query, or data structure for another…
Failure to Sanitize Special Elements into a Different Plane (Special Element Injection)
This vulnerability occurs when an application fails to properly filter or encode user-supplied data containing special characters or…
Improper Neutralization of Special Elements used in a Command ('Command Injection')
This vulnerability occurs when an application builds a system command using untrusted user input without properly sanitizing it. An…
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
OS Command Injection occurs when an application builds a system command using untrusted, external input without properly sanitizing it.…
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
This vulnerability occurs when a web application fails to properly sanitize or encode user-supplied input before displaying it on a…
Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')
This vulnerability occurs when an application builds a command string for execution by another component, but fails to properly separate…
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
SQL Injection occurs when an application builds a database query using untrusted user input without properly sanitizing it. This allows an…
XML Injection (aka Blind XPath Injection)
XML Injection occurs when an application fails to properly validate or escape user-controlled input before including it in XML documents…
Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection')
Expression Language Injection occurs when an application uses untrusted, external input to build an expression language statement—common…
Further reading
- MITRE — CWE-1236 officiel https://cwe.mitre.org/data/definitions/1236.html
- CSV Injection https://owasp.org/www-community/attacks/CSV_Injection
- Data Extraction to Command Execution CSV Injection https://www.veracode.com/blog/secure-development/data-extraction-command-execution-csv-injection
- The Absurdly Underestimated Dangers of CSV Injection https://georgemauer.net/2017/10/07/csv-injection.html
- Comma Separated Vulnerabilities https://rstforums.com/forum/topic/82690-comma-separated-vulnerabilities/
Arrêtez de payer par développeur.
Commencez à fermer la boucle.
Plexicus est l'ASPM natif IA qui scanne, filtre, corrige, penteste et explique — de façon autonome. Développeurs illimités, dépôts illimités, actions IA à usage équitable. Vrai niveau gratuit, €269/mo annuel quand vous êtes prêt.