{"@ID": "94", "@Name": "Improper Control of Generation of Code ('Code Injection')", "@Abstraction": "Base", "@Structure": "Simple", "@Status": "Draft", "@Diagram": "/data/images/CWE-94-Diagram.png", "Description": "The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.", "Related_Weaknesses": {"Related_Weakness": [{"@Nature": "ChildOf", "@CWE_ID": "74", "@View_ID": "1000", "@Ordinal": "Primary"}, {"@Nature": "ChildOf", "@CWE_ID": "74", "@View_ID": "1003", "@Ordinal": "Primary"}, {"@Nature": "ChildOf", "@CWE_ID": "913", "@View_ID": "1000"}]}, "Weakness_Ordinalities": {"Weakness_Ordinality": [{"Ordinality": "Primary"}, {"Ordinality": "Resultant"}]}, "Applicable_Platforms": {"Language": {"@Class": "Interpreted", "@Prevalence": "Sometimes"}, "Technology": {"@Name": "AI/ML", "@Prevalence": "Undetermined"}}, "Alternate_Terms": {"Alternate_Term": {"Term": "Code Injection"}}, "Modes_Of_Introduction": {"Introduction": {"Phase": "Implementation", "Note": "REALIZATION: This weakness is caused during implementation of an architectural security tactic."}}, "Likelihood_Of_Exploit": "Medium", "Common_Consequences": {"Consequence": [{"Scope": "Access Control", "Impact": "Bypass Protection Mechanism", "Note": "In some cases, injectable code controls authentication; this may lead to a remote vulnerability."}, {"Scope": "Access Control", "Impact": "Gain Privileges or Assume Identity", "Note": "Injected code can access resources that the attacker is directly prevented from accessing."}, {"Scope": ["Integrity", "Confidentiality", "Availability"], "Impact": "Execute Unauthorized Code or Commands", "Note": "When a product allows a user's input to contain code syntax, it might be possible for an attacker to craft the code in such a way that it will alter the intended control flow of the product. As a result, code injection can often result in the execution of arbitrary code. Code injection   attacks can also lead to loss of data integrity in nearly all cases, since the control-plane data injected is always incidental to data recall or writing."}, {"Scope": "Non-Repudiation", "Impact": "Hide Activities", "Note": "Often the actions performed by injected control code are unlogged."}]}, "Detection_Methods": {"Detection_Method": {"@Detection_Method_ID": "DM-14", "Method": "Automated Static Analysis", "Description": "Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect \"sources\" (origins of input) with \"sinks\" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)", "Effectiveness": "High"}}, "Potential_Mitigations": {"Mitigation": [{"Phase": "Architecture and Design", "Strategy": "Refactoring", "Description": "Refactor your program so that you do not have to dynamically generate code."}, {"Phase": "Architecture and Design", "Description": {"xhtml:p": ["Run your code in a \"jail\" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which code can be executed by your product.", "Examples include the Unix chroot jail and AppArmor. In general, managed code may provide some protection.", "This may not be a feasible solution, and it only limits the impact to the operating system; the rest of your application may still be subject to compromise.", "Be careful to avoid CWE-243 and other weaknesses related to jails."]}}, {"@Mitigation_ID": "MIT-5", "Phase": "Implementation", "Strategy": "Input Validation", "Description": {"xhtml:p": ["Assume all input is malicious. Use an \"accept known good\" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.", "When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, \"boat\" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as \"red\" or \"blue.\"", "Do not rely exclusively on looking for malicious or malformed inputs.  This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.", "To reduce the likelihood of code injection, use stringent allowlists that limit which constructs are allowed. If you are dynamically constructing code that invokes a function, then verifying that the input is alphanumeric might be insufficient. An attacker might still be able to reference a dangerous function that you did not intend to allow, such as system(), exec(), or exit()."]}}, {"Phase": "Testing", "Description": "Use dynamic tools and techniques that interact with the product using large test suites with many diverse inputs, such as fuzz testing (fuzzing), robustness testing, and fault injection. The product's operation may slow down, but it should not become unstable, crash, or generate incorrect results."}, {"@Mitigation_ID": "MIT-32", "Phase": "Operation", "Strategy": "Compilation or Build Hardening", "Description": "Run the code in an environment that performs automatic taint propagation and prevents any command execution that uses tainted variables, such as Perl's \"-T\" switch. This will force the program to perform validation steps that remove the taint, although you must be careful to correctly validate your inputs so that you do not accidentally mark dangerous inputs as untainted (see CWE-183 and CWE-184)."}, {"@Mitigation_ID": "MIT-32", "Phase": "Operation", "Strategy": "Environment Hardening", "Description": "Run the code in an environment that performs automatic taint propagation and prevents any command execution that uses tainted variables, such as Perl's \"-T\" switch. This will force the program to perform validation steps that remove the taint, although you must be careful to correctly validate your inputs so that you do not accidentally mark dangerous inputs as untainted (see CWE-183 and CWE-184)."}, {"Phase": "Implementation", "Description": {"xhtml:p": "For Python programs, it is frequently encouraged to use the ast.literal_eval() function instead of eval, since it is intentionally designed to avoid executing code. However, an adversary could still cause excessive memory or stack consumption via deeply nested structures [REF-1372], so the python documentation discourages use of ast.literal_eval() on untrusted data [REF-1373]."}, "Effectiveness": "Discouraged Common Practice"}]}, "Demonstrative_Examples": {"Demonstrative_Example": [{"@Demonstrative_Example_ID": "DX-32", "Intro_Text": "This example attempts to write user messages to a message file and allow users to view them.", "Example_Code": [{"@Nature": "Bad", "@Language": "PHP", "xhtml:div": {"xhtml:br": [null, null], "xhtml:div": [{"@style": "margin-left:1em;", "xhtml:br": [null, null, null, null, null], "#text": "$name = $_GET[\"name\"];$message = $_GET[\"message\"];$handle = fopen($MessageFile, \"a+\");fwrite($handle, \"<b>$name</b> says '$message'<hr>\\n\");fclose($handle);echo \"Message Saved!<p>\\n\";"}, {"@style": "margin-left:1em;", "#text": "include($MessageFile);"}], "#text": "$MessageFile = \"messages.out\";if ($_GET[\"action\"] == \"NewMessage\") {}else if ($_GET[\"action\"] == \"ViewMessages\") {}"}}, {"@Nature": "Attack", "xhtml:div": {"xhtml:br": null, "#text": "name=h4x0rmessage=%3C?php%20system(%22/bin/ls%20-l%22);?%3E"}}, {"@Nature": "Attack", "xhtml:div": "<?php system(\"/bin/ls -l\");?>"}], "Body_Text": ["While the programmer intends for the MessageFile to only include data, an attacker can provide a message such as:", "which will decode to the following:", "The programmer thought they were just including the contents of a regular data file, but PHP parsed it and executed the code. Now, this code is executed any time people view messages.", "Notice that XSS (CWE-79) is also possible in this situation."]}, {"@Demonstrative_Example_ID": "DX-31", "Intro_Text": "edit-config.pl: This CGI script is used to modify settings in a configuration file.", "Example_Code": [{"@Nature": "Bad", "@Language": "Perl", "xhtml:div": {"xhtml:br": [null, null, null, null, null, null, null, null, null, null, null, null, null], "xhtml:div": [{"@style": "margin-left:1em;", "xhtml:div": {"xhtml:br": [null, null, null], "xhtml:i": "# code to add a field/key to a file goes here", "#text": "my ($fname, $key, $arg) = @_;"}}, {"@style": "margin-left:1em;", "xhtml:div": {"xhtml:br": [null, null, null], "xhtml:i": "# code to set key to a particular file goes here", "#text": "my ($fname, $key, $arg) = @_;"}}, {"@style": "margin-left:1em;", "xhtml:div": {"xhtml:br": [null, null, null], "xhtml:i": "# code to delete key from a particular file goes here", "#text": "my ($fname, $key, $arg) = @_;"}}, {"@style": "margin-left:1em;", "xhtml:div": {"xhtml:br": [null, null, null, null, null, null, null, null, null, null], "xhtml:i": ["# this is super-efficient code, especially if you have to invoke", "# any one of dozens of different functions!"], "#text": "my ($fname, $action) = @_;my $key = param('key');my $val = param('val');\n                           \n                           \n                           \n                           \n                           \n                           \n                           \n                           my $code = \"config_file_$action_key(\\$fname, \\$key, \\$val);\";eval($code);"}}, {"@style": "margin-left:1em;", "#text": "handleConfigAction($configfile, param('action'));"}, {"@style": "margin-left:1em;", "#text": "print \"No action specified!\\n\";"}], "#text": "use CGI qw(:standard);\n                     sub config_file_add_key {}\n                     sub config_file_set_key {}\n                     sub config_file_delete_key {}\n                     sub handleConfigAction {}\n                     $configfile = \"/home/cwe/config.txt\";print header;if (defined(param('action'))) {}else {}"}}, {"@Nature": "Attack", "xhtml:div": "add_key(\",\",\"); system(\"/bin/ls\");"}, {"@Nature": "Result", "xhtml:div": "config_file_add_key(\",\",\"); system(\"/bin/ls\");"}], "Body_Text": ["The script intends to take the 'action' parameter and invoke one of a variety of functions based on the value of that parameter - config_file_add_key(), config_file_set_key(), or config_file_delete_key(). It could set up a conditional to invoke each function separately, but eval() is a powerful way of doing the same thing in fewer lines of code, especially when a large number of functions or variables are involved. Unfortunately, in this case, the attacker can provide other values in the action parameter, such as:", "This would produce the following string in handleConfigAction():", "Any arbitrary Perl code could be added after the attacker has \"closed off\" the construction of the original function call, in order to prevent parsing errors from causing the malicious eval() to fail before the attacker's payload is activated. This particular manipulation would fail after the system() call, because the \"_key(\\$fname, \\$key, \\$val)\" portion of the string would cause an error, but this is irrelevant to the attack because the payload has already been activated."]}, {"@Demonstrative_Example_ID": "DX-156", "Intro_Text": "This simple python3 script asks a user to supply a comma-separated list of numbers as input and adds them together.", "Example_Code": [{"@Nature": "Bad", "@Language": "Python", "xhtml:div": {"xhtml:br": null, "xhtml:div": {"@style": "margin-left:1em;", "xhtml:br": [null, null, null, null], "xhtml:div": [{"@style": "margin-left:1em;", "xhtml:br": null, "#text": "numbers = eval(input(\"Enter a comma-separated list of numbers: \"))"}, {"@style": "margin-left:1em;", "xhtml:br": null, "#text": "print(\"Error: invalid input\")\n\t\t      return"}, {"@style": "margin-left:1em;", "xhtml:br": null, "#text": "sum = sum + num"}], "#text": "sum = 0\n\t\t    try:\n\t\t    \n\t\t    except SyntaxError:\n\t\t    \n                    for num in numbers:\n                    \n                    print(f\"Sum of {numbers} = {sum}\")"}, "#text": "def main():\n                  \n                  main()"}}, {"@Nature": "Attack", "xhtml:div": "__import__('subprocess').getoutput('rm -r *')"}, {"@Nature": "Good", "@Language": "Python", "xhtml:div": {"xhtml:br": null, "xhtml:div": {"@style": "margin-left:1em;", "xhtml:br": [null, null, null, null], "xhtml:div": [{"@style": "margin-left:1em;", "xhtml:br": null, "xhtml:div": {"@style": "margin-left:1em;", "xhtml:br": null, "#text": "sum = sum + int(num)"}, "#text": "for num in numbers:\n                      \n                      print(f\"Sum of {numbers} = {sum}\")"}, {"@style": "margin-left:1em;", "xhtml:br": null, "#text": "print(\"Error: invalid input\")"}], "#text": "sum = 0\n                    numbers = input(\"Enter a comma-separated list of numbers: \").split(\",\")\n                    try:\n                    \n                    except ValueError:"}, "#text": "def main():\n                  \n                  main()"}}], "Body_Text": ["The eval() function can take the user-supplied list and convert it into a Python list object, therefore allowing the programmer to use list comprehension methods to work with the data. However, if code is supplied to the eval() function, it will execute that code. For example, a malicious user could supply the following string:", "This would delete all the files in the current directory. For this reason, it is not recommended to use eval() with untrusted input.", "A way to accomplish this without the use of eval() is to apply an integer conversion on the input within a try/except block. If the user-supplied input is not numeric, this will raise a ValueError. By avoiding eval(), there is no opportunity for the input string to be executed as code.", "An alternative, commonly-cited mitigation for this kind of weakness is to use the ast.literal_eval() function, since it is intentionally designed to avoid executing code. However, an adversary could still cause excessive memory or stack consumption via deeply nested structures [REF-1372], so the python documentation discourages use of ast.literal_eval() on untrusted data [REF-1373]."]}, {"@Demonstrative_Example_ID": "DX-236", "Intro_Text": "The following code is a workflow job written\n\t      using YAML. The code attempts to download pull request\n\t      artifacts, unzip from the artifact called pr.zip and\n\t      extract the value of the file NR into a variable\n\t      \"pr_number\" that will be used later in another job.  It\n\t      attempts to create a github workflow environment\n\t      variable, writing to $GITHUB_ENV. The environment\n\t      variable value is retrieved from an external\n\t      resource.", "Example_Code": [{"@Nature": "Bad", "@Language": "Other", "xhtml:br": [null, null], "xhtml:div": {"@style": "margin-left:1em;", "xhtml:br": null, "xhtml:div": {"@style": "margin-left:1em;", "xhtml:br": [null, null], "xhtml:div": {"@style": "margin-left:1em;", "xhtml:br": [null, null, null, null], "xhtml:div": [{"@style": "margin-left:1em;", "xhtml:br": null, "xhtml:div": {"@style": "margin-left:1em;", "xhtml:br": [null, null, null, null, null, null, null, null], "xhtml:div": [{"@style": "margin-left:1em;", "xhtml:br": [null, null, null], "#text": "owner: context.repo.owner,\n\t\t\t    repo: context.repo.repo,\n\t\t\t    run_id: ${{ github.event.workflow_run.id }},"}, {"@style": "margin-left:1em;", "xhtml:br": null, "#text": "return artifact.name == \"pr\""}, {"@style": "margin-left:1em;", "xhtml:br": [null, null, null, null], "#text": "owner: context.repo.owner,\n\t\t\t    repo: context.repo.repo,\n\t\t\t    artifact_id: matchPrArtifact.id,\n\t\t\t    archive_format: 'zip',"}], "#text": "var artifacts = await github.actions.listWorkflowRunArtifacts({\n\t\t\t  \n\t\t\t  });\n\t\t\t  var matchPrArtifact = artifacts.data.artifacts.filter((artifact) => {\n\t\t\t  \n\t\t\t  })[0];\n\t\t\t  var downloadPr = await github.actions.downloadArtifact({\n\t\t\t  \n\t\t\t  });\n\t\t\t  var fs = require('fs');\n\t\t\t  fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(downloadPr.data));"}, "#text": "script: |"}, {"@style": "margin-left:1em;", "xhtml:br": null, "#text": "unzip pr.zip\n\t\t\techo \"pr_number=$(cat NR)\" >> $GITHUB_ENV"}], "#text": "- name: 'Download artifact'\n\t\t      uses: actions/github-script\n\t\t      with:\n\t\t      \n\t\t      - run: |"}, "#text": "runs-on: ubuntu-latest\n\t\t    steps:"}, "#text": "deploy:"}, "#text": "name: Deploy Preview\n\t\tjobs:"}, {"@Nature": "Attack", "#text": "\\nNODE_OPTIONS=\"--experimental-modules --experiments-loader=data:text/javascript,console.log('injected code');//\""}, {"@Nature": "Good", "@Language": "Other", "#text": "The code could be modified to validate that the NR\n\t\tfile only contains a numeric value, or the code could\n\t\tretrieve the PR number from a more trusted source."}], "Body_Text": [{"xhtml:p": ["The code does not neutralize the value of the\n\t      file NR, e.g. by validating that NR only contains a\n\t      number (CWE-1284). The NR file is attacker controlled\n\t      because it originates from a pull request that produced\n\t      pr.zip.", "The attacker could escape the existing\n\t      pr_number and create a new variable using a \"\\n\"\n\t      (CWE-93) followed by any environment variable to be\n\t      added such as:"]}, {"xhtml:p": "This would result in injecting and running\n\t      javascript code (CWE-94) on the workflow runner with\n\t      elevated privileges."}]}]}, "Observed_Examples": {"Observed_Example": [{"Reference": "CVE-2023-29374", "Description": "Math component in an LLM framework translates user input into a Python\n\t\t\t   expression that is input into the Python exec() method, allowing code\n\t\t\t   execution - one variant of a \"prompt injection\" attack.", "Link": "https://www.cve.org/CVERecord?id=CVE-2023-29374"}, {"Reference": "CVE-2024-5565", "Description": "Python-based library uses an LLM prompt containing user input to\n\t\t\t   dynamically generate code that is then fed as input into the Python\n\t\t\t   exec() method, allowing code execution - one variant of a \"prompt\n\t\t\t   injection\" attack.", "Link": "https://www.cve.org/CVERecord?id=CVE-2024-5565"}, {"Reference": "CVE-2024-4181", "Description": "Framework for LLM applications allows eval injection via a crafted response from a hosting provider.", "Link": "https://www.cve.org/CVERecord?id=CVE-2024-4181"}, {"Reference": "CVE-2022-2054", "Description": "Python compiler uses eval() to execute malicious strings as Python code.", "Link": "https://www.cve.org/CVERecord?id=CVE-2022-2054"}, {"Reference": "CVE-2021-22204", "Description": "Chain: regex in EXIF processor code does not correctly determine where a string ends (CWE-625), enabling eval injection (CWE-95), as exploited in the wild per CISA KEV.", "Link": "https://www.cve.org/CVERecord?id=CVE-2021-22204"}, {"Reference": "CVE-2020-8218", "Description": "\"Code injection\" in VPN product, as exploited in the wild per CISA KEV.", "Link": "https://www.cve.org/CVERecord?id=CVE-2020-8218"}, {"Reference": "CVE-2008-5071", "Description": "Eval injection in PHP program.", "Link": "https://www.cve.org/CVERecord?id=CVE-2008-5071"}, {"Reference": "CVE-2002-1750", "Description": "Eval injection in Perl program.", "Link": "https://www.cve.org/CVERecord?id=CVE-2002-1750"}, {"Reference": "CVE-2008-5305", "Description": "Eval injection in Perl program using an ID that should only contain hyphens and numbers.", "Link": "https://www.cve.org/CVERecord?id=CVE-2008-5305"}, {"Reference": "CVE-2002-1752", "Description": "Direct code injection into Perl eval function.", "Link": "https://www.cve.org/CVERecord?id=CVE-2002-1752"}, {"Reference": "CVE-2002-1753", "Description": "Eval injection in Perl program.", "Link": "https://www.cve.org/CVERecord?id=CVE-2002-1753"}, {"Reference": "CVE-2005-1527", "Description": "Direct code injection into Perl eval function.", "Link": "https://www.cve.org/CVERecord?id=CVE-2005-1527"}, {"Reference": "CVE-2005-2837", "Description": "Direct code injection into Perl eval function.", "Link": "https://www.cve.org/CVERecord?id=CVE-2005-2837"}, {"Reference": "CVE-2005-1921", "Description": "MFV. code injection into PHP eval statement using nested constructs that should not be nested.", "Link": "https://www.cve.org/CVERecord?id=CVE-2005-1921"}, {"Reference": "CVE-2005-2498", "Description": "MFV. code injection into PHP eval statement using nested constructs that should not be nested.", "Link": "https://www.cve.org/CVERecord?id=CVE-2005-2498"}, {"Reference": "CVE-2005-3302", "Description": "Code injection into Python eval statement from a field in a formatted file.", "Link": "https://www.cve.org/CVERecord?id=CVE-2005-3302"}, {"Reference": "CVE-2007-1253", "Description": "Eval injection in Python program.", "Link": "https://www.cve.org/CVERecord?id=CVE-2007-1253"}, {"Reference": "CVE-2001-1471", "Description": "chain: Resultant eval injection. An invalid value prevents initialization of variables, which can be modified by attacker and later injected into PHP eval statement.", "Link": "https://www.cve.org/CVERecord?id=CVE-2001-1471"}, {"Reference": "CVE-2002-0495", "Description": "Perl code directly injected into CGI library file from parameters to another CGI program.", "Link": "https://www.cve.org/CVERecord?id=CVE-2002-0495"}, {"Reference": "CVE-2005-1876", "Description": "Direct PHP code injection into supporting template file.", "Link": "https://www.cve.org/CVERecord?id=CVE-2005-1876"}, {"Reference": "CVE-2005-1894", "Description": "Direct code injection into PHP script that can be accessed by attacker.", "Link": "https://www.cve.org/CVERecord?id=CVE-2005-1894"}, {"Reference": "CVE-2003-0395", "Description": "PHP code from User-Agent HTTP header directly inserted into log file implemented as PHP script.", "Link": "https://www.cve.org/CVERecord?id=CVE-2003-0395"}]}, "Taxonomy_Mappings": {"Taxonomy_Mapping": [{"@Taxonomy_Name": "PLOVER", "Entry_ID": "CODE", "Entry_Name": "Code Evaluation and Injection"}, {"@Taxonomy_Name": "ISA/IEC 62443", "Entry_ID": "Part 4-2", "Entry_Name": "Req CR 3.5"}, {"@Taxonomy_Name": "ISA/IEC 62443", "Entry_ID": "Part 3-3", "Entry_Name": "Req SR 3.5"}, {"@Taxonomy_Name": "ISA/IEC 62443", "Entry_ID": "Part 4-1", "Entry_Name": "Req SVV-1"}, {"@Taxonomy_Name": "ISA/IEC 62443", "Entry_ID": "Part 4-1", "Entry_Name": "Req SVV-3"}]}, "Related_Attack_Patterns": {"Related_Attack_Pattern": [{"@CAPEC_ID": "242"}, {"@CAPEC_ID": "35"}, {"@CAPEC_ID": "77"}]}, "References": {"Reference": [{"@External_Reference_ID": "REF-44", "@Section": "\"Sin 3: Web-Client Related Vulnerabilities (XSS).\" Page 63"}, {"@External_Reference_ID": "REF-1372"}, {"@External_Reference_ID": "REF-1373", "@Section": "ast.literal_eval(node_or_string)"}]}, "Mapping_Notes": {"Usage": "Allowed-with-Review", "Rationale": "This entry is frequently misused for vulnerabilities with a technical impact of \"code execution,\" which does not by itself indicate a root cause weakness, since dozens of weaknesses can enable code execution.", "Comments": "This weakness only applies when the product's functionality intentionally constructs all or part of a code segment. It could be that executing code could be the result of other weaknesses that do not involve the construction of code segments.", "Reasons": {"Reason": [{"@Type": "Frequent Misuse"}, {"@Type": "Frequent Misinterpretation"}]}}, "Notes": {"Note": {"@Type": "Theoretical", "xhtml:p": "Injection problems encompass a wide variety of issues -- all mitigated in very different ways. For this reason, the most effective way to discuss these weaknesses is to note the distinct features that classify them as injection weaknesses. The most important issue to note is that all injection problems share one thing in common -- i.e., they allow for the injection of control plane data into the user-controlled data plane. This means that the execution of the process may be altered by sending code in through legitimate data channels, using no other mechanism. While buffer overflows, and many other flaws, involve the use of some further issue to gain execution, injection problems need only for the data to be parsed. The most classic instantiations of this category of weakness are SQL injection and format string vulnerabilities."}}, "Content_History": {"Submission": {"Submission_Name": "PLOVER", "Submission_Date": "2006-07-19", "Submission_Version": "Draft 3", "Submission_ReleaseDate": "2006-07-19"}, "Modification": [{"Modification_Name": "Eric Dalci", "Modification_Organization": "Cigital", "Modification_Date": "2008-07-01", "Modification_Version": "1.0", "Modification_ReleaseDate": "2008-09-09", "Modification_Comment": "updated Time_of_Introduction"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2008-09-08", "Modification_Version": "1.0", "Modification_ReleaseDate": "2008-09-09", "Modification_Comment": "updated Applicable_Platforms, Relationships, Research_Gaps, Taxonomy_Mappings"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2009-01-12", "Modification_Version": "1.2", "Modification_ReleaseDate": "2009-01-12", "Modification_Comment": "updated Common_Consequences, Demonstrative_Examples, Description, Likelihood_of_Exploit, Name, Potential_Mitigations, Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2009-03-10", "Modification_Version": "1.3", "Modification_ReleaseDate": "2009-03-10", "Modification_Comment": "updated Potential_Mitigations"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2009-05-27", "Modification_Version": "1.4", "Modification_ReleaseDate": "2009-05-27", "Modification_Comment": "updated Demonstrative_Examples, Name"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2010-02-16", "Modification_Version": "1.8", "Modification_ReleaseDate": "2010-02-16", "Modification_Comment": "updated Potential_Mitigations"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2010-06-21", "Modification_Version": "1.9", "Modification_ReleaseDate": "2010-06-21", "Modification_Comment": "updated Description, Potential_Mitigations"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2011-03-29", "Modification_Version": "1.12", "Modification_ReleaseDate": "2011-03-30", "Modification_Comment": "updated Name"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2011-06-01", "Modification_Version": "1.13", "Modification_ReleaseDate": "2011-06-01", "Modification_Comment": "updated Common_Consequences"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2012-05-11", "Modification_Version": "2.2", "Modification_ReleaseDate": "2012-05-15", "Modification_Comment": "updated Common_Consequences, Demonstrative_Examples, Observed_Examples, References, Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2012-10-30", "Modification_Version": "2.3", "Modification_ReleaseDate": "2012-10-30", "Modification_Comment": "updated Potential_Mitigations"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2013-02-21", "Modification_Version": "2.4", "Modification_ReleaseDate": "2013-02-21", "Modification_Comment": "updated Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2014-07-30", "Modification_Version": "2.8", "Modification_ReleaseDate": "2014-07-31", "Modification_Comment": "updated Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2015-12-07", "Modification_Version": "2.9", "Modification_ReleaseDate": "2015-12-07", "Modification_Comment": "updated Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2017-11-08", "Modification_Version": "3.0", "Modification_ReleaseDate": "2017-11-08", "Modification_Comment": "updated Demonstrative_Examples, Modes_of_Introduction, Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2019-06-20", "Modification_Version": "3.3", "Modification_ReleaseDate": "2019-06-20", "Modification_Comment": "updated Related_Attack_Patterns, Type"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2019-09-19", "Modification_Version": "3.4", "Modification_ReleaseDate": "2019-09-19", "Modification_Comment": "updated Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2020-02-24", "Modification_Version": "4.0", "Modification_ReleaseDate": "2020-02-24", "Modification_Comment": "updated Potential_Mitigations, Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2020-06-25", "Modification_Version": "4.1", "Modification_ReleaseDate": "2020-06-25", "Modification_Comment": "updated Potential_Mitigations"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2020-08-20", "Modification_Version": "4.2", "Modification_ReleaseDate": "2020-08-20", "Modification_Comment": "updated Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2021-03-15", "Modification_Version": "4.4", "Modification_ReleaseDate": "2021-03-15", "Modification_Comment": "updated Demonstrative_Examples"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2021-07-20", "Modification_Version": "4.5", "Modification_ReleaseDate": "2021-07-20", "Modification_Comment": "updated Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2021-10-28", "Modification_Version": "4.6", "Modification_ReleaseDate": "2021-10-28", "Modification_Comment": "updated Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2022-04-28", "Modification_Version": "4.7", "Modification_ReleaseDate": "2022-04-28", "Modification_Comment": "updated Research_Gaps"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2022-06-28", "Modification_Version": "4.8", "Modification_ReleaseDate": "2022-06-28", "Modification_Comment": "updated Observed_Examples, Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2022-10-13", "Modification_Version": "4.9", "Modification_ReleaseDate": "2022-10-13", "Modification_Comment": "updated Observed_Examples"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2023-01-31", "Modification_Version": "4.10", "Modification_ReleaseDate": "2023-01-31", "Modification_Comment": "updated Demonstrative_Examples, Description, Potential_Mitigations, Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2023-04-27", "Modification_Version": "4.11", "Modification_ReleaseDate": "2023-04-27", "Modification_Comment": "updated Demonstrative_Examples, Detection_Factors, Relationships, Time_of_Introduction"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2023-06-29", "Modification_Version": "4.12", "Modification_ReleaseDate": "2023-06-29", "Modification_Comment": "updated Mapping_Notes, Relationships, Taxonomy_Mappings"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2024-02-29", "Modification_Version": "4.14", "Modification_ReleaseDate": "2024-02-29", "Modification_Comment": "updated Demonstrative_Examples, Potential_Mitigations, References"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2024-07-16", "Modification_Version": "4.15", "Modification_ReleaseDate": "2024-07-16", "Modification_Comment": "updated Applicable_Platforms, Observed_Examples"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2024-11-19", "Modification_Version": "4.16", "Modification_ReleaseDate": "2024-11-19", "Modification_Comment": "updated Mapping_Notes, Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2025-04-03", "Modification_Version": "4.17", "Modification_ReleaseDate": "2025-04-03", "Modification_Comment": "updated Alternate_Terms, Common_Consequences, Description, Diagram, Theoretical_Notes"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2025-12-11", "Modification_Version": "4.19", "Modification_ReleaseDate": "2025-12-11", "Modification_Comment": "updated Demonstrative_Examples, Relationships, Weakness_Ordinalities"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2026-04-30", "Modification_Version": "4.20", "Modification_ReleaseDate": "2026-04-30", "Modification_Comment": "updated Potential_Mitigations, Relationships"}], "Contribution": [{"@Type": "Content", "Contribution_Name": "\"Mapping CWE to 62443\" Sub-Working Group", "Contribution_Organization": "CWE-CAPEC ICS/OT SIG", "Contribution_Date": "2023-06-29", "Contribution_Version": "4.12", "Contribution_ReleaseDate": "2023-06-29", "Contribution_Comment": "Suggested mappings to ISA/IEC 62443."}, {"@Type": "Content", "Contribution_Name": "Abhi Balakrishnan", "Contribution_Date": "2024-02-29", "Contribution_Version": "4.17", "Contribution_ReleaseDate": "2025-04-03", "Contribution_Comment": "Contributed usability diagram concepts used by the CWE team."}, {"@Type": "Feedback", "Contribution_Name": "Matthew A. Pagan", "Contribution_Organization": "Spectrum", "Contribution_Date": "2025-08-22", "Contribution_Version": "4.19", "Contribution_ReleaseDate": "2025-12-11", "Contribution_Comment": "Discovered a syntax issue in the Python3 demox (DX-156) and suggested a fix"}], "Previous_Entry_Name": [{"@Date": "2009-01-12", "#text": "Code Injection"}, {"@Date": "2009-05-27", "#text": "Failure to Control Generation of Code (aka 'Code Injection')"}, {"@Date": "2011-03-29", "#text": "Failure to Control Generation of Code ('Code Injection')"}]}}
