Common Weakness Enumeration

CWE-94

Allowed-with-Review

Improper Control of Generation of Code ('Code Injection')

Abstraction: Base · Status: Draft

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.

8301 vulnerabilities reference this CWE, most recent first.

GHSA-VV2H-2W3Q-3FX7

Vulnerability from github – Published: 2025-02-11 15:32 – Updated: 2025-02-11 21:41
VLAI
Summary
PandasAI interactive prompt function Remote Code Execution (RCE)
Details

PandasAI uses an interactive prompt function that is vulnerable to prompt injection and run arbitrary Python code that can lead to Remote Code Execution (RCE) instead of the intended explanation of the natural language processing by the LLM. The security controls of PandasAI (2.4.3 and earlier) fail to distinguish between legitimate and malicious inputs, allowing the attackers to manipulate the system into executing untrusted code, leading to untrusted code execution (RCE), system compromise, or pivoting attacks on connected services.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "pandasai"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "last_affected": "2.4.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2024-12366"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2025-02-11T18:03:09Z",
    "nvd_published_at": "2025-02-11T13:15:29Z",
    "severity": "CRITICAL"
  },
  "details": "PandasAI uses an interactive prompt function that is vulnerable to prompt injection and run arbitrary Python code that can lead to Remote Code Execution (RCE) instead of the intended explanation of the natural language processing by the LLM. The security controls of PandasAI (2.4.3 and earlier) fail to distinguish between legitimate and malicious inputs, allowing the attackers to manipulate the system into executing untrusted code, leading to untrusted code execution (RCE), system compromise, or pivoting attacks on connected services.",
  "id": "GHSA-vv2h-2w3q-3fx7",
  "modified": "2025-02-11T21:41:47Z",
  "published": "2025-02-11T15:32:24Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-12366"
    },
    {
      "type": "WEB",
      "url": "https://docs.getpanda.ai/v3/privacy-security"
    },
    {
      "type": "WEB",
      "url": "https://docs.pandas-ai.com/advanced-security-agent"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/sinaptik-ai/pandas-ai"
    },
    {
      "type": "WEB",
      "url": "https://www.kb.cert.org/vuls/id/148244"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "PandasAI interactive prompt function Remote Code Execution (RCE)"
}

GHSA-VV36-MQ5M-MGC9

Vulnerability from github – Published: 2022-05-01 23:39 – Updated: 2025-04-09 03:52
VLAI
Details

PHP remote file inclusion vulnerability in code/display.php in fuzzylime (cms) 3.01 allows remote attackers to execute arbitrary PHP code via a URL in the admindir parameter.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2008-1405"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2008-03-20T10:44:00Z",
    "severity": "MODERATE"
  },
  "details": "PHP remote file inclusion vulnerability in code/display.php in fuzzylime (cms) 3.01 allows remote attackers to execute arbitrary PHP code via a URL in the admindir parameter.",
  "id": "GHSA-vv36-mq5m-mgc9",
  "modified": "2025-04-09T03:52:47Z",
  "published": "2022-05-01T23:39:58Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2008-1405"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/41221"
    },
    {
      "type": "WEB",
      "url": "https://www.exploit-db.com/exploits/5260"
    },
    {
      "type": "WEB",
      "url": "http://irk4z.wordpress.com/2008/03/15/fuzzylime-cms-301-remote-file-inclusion-vulnerability"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/29417"
    },
    {
      "type": "WEB",
      "url": "http://www.vupen.com/english/advisories/2008/0912/references"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-VV62-CCXV-738X

Vulnerability from github – Published: 2022-05-01 23:31 – Updated: 2022-05-01 23:31
VLAI
Details

The vmsplice_to_pipe function in Linux kernel 2.6.17 through 2.6.24.1 does not validate a certain userspace pointer before dereference, which allows local users to gain root privileges via crafted arguments in a vmsplice system call, a different vulnerability than CVE-2008-0009 and CVE-2008-0010.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2008-0600"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2008-02-12T21:00:00Z",
    "severity": "HIGH"
  },
  "details": "The vmsplice_to_pipe function in Linux kernel 2.6.17 through 2.6.24.1 does not validate a certain userspace pointer before dereference, which allows local users to gain root privileges via crafted arguments in a vmsplice system call, a different vulnerability than CVE-2008-0009 and CVE-2008-0010.",
  "id": "GHSA-vv62-ccxv-738x",
  "modified": "2022-05-01T23:31:47Z",
  "published": "2022-05-01T23:31:47Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2008-0600"
    },
    {
      "type": "WEB",
      "url": "https://access.redhat.com/errata/RHSA-2008:0129"
    },
    {
      "type": "WEB",
      "url": "https://access.redhat.com/security/cve/CVE-2008-0600"
    },
    {
      "type": "WEB",
      "url": "https://bugzilla.redhat.com/show_bug.cgi?id=432229"
    },
    {
      "type": "WEB",
      "url": "https://bugzilla.redhat.com/show_bug.cgi?id=432251"
    },
    {
      "type": "WEB",
      "url": "https://bugzilla.redhat.com/show_bug.cgi?id=432517"
    },
    {
      "type": "WEB",
      "url": "https://issues.rpath.com/browse/RPL-2237"
    },
    {
      "type": "WEB",
      "url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A11358"
    },
    {
      "type": "WEB",
      "url": "https://www.exploit-db.com/exploits/5092"
    },
    {
      "type": "WEB",
      "url": "https://www.redhat.com/archives/fedora-package-announce/2008-February/msg00254.html"
    },
    {
      "type": "WEB",
      "url": "https://www.redhat.com/archives/fedora-package-announce/2008-February/msg00255.html"
    },
    {
      "type": "WEB",
      "url": "https://www.redhat.com/archives/fedora-package-announce/2008-February/msg00270.html"
    },
    {
      "type": "WEB",
      "url": "https://www.redhat.com/archives/fedora-package-announce/2008-February/msg00485.html"
    },
    {
      "type": "WEB",
      "url": "http://lists.opensuse.org/opensuse-security-announce/2008-02/msg00005.html"
    },
    {
      "type": "WEB",
      "url": "http://lists.opensuse.org/opensuse-security-announce/2008-03/msg00002.html"
    },
    {
      "type": "WEB",
      "url": "http://lists.opensuse.org/opensuse-security-announce/2008-06/msg00006.html"
    },
    {
      "type": "WEB",
      "url": "http://marc.info/?l=linux-kernel\u0026m=120263652322197\u0026w=2"
    },
    {
      "type": "WEB",
      "url": "http://marc.info/?l=linux-kernel\u0026m=120264520431307\u0026w=2"
    },
    {
      "type": "WEB",
      "url": "http://marc.info/?l=linux-kernel\u0026m=120264773202422\u0026w=2"
    },
    {
      "type": "WEB",
      "url": "http://marc.info/?l=linux-kernel\u0026m=120266328220808\u0026w=2"
    },
    {
      "type": "WEB",
      "url": "http://marc.info/?l=linux-kernel\u0026m=120266353621139\u0026w=2"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/28835"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/28858"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/28875"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/28889"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/28896"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/28912"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/28925"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/28933"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/28937"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/29245"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/30818"
    },
    {
      "type": "WEB",
      "url": "http://securitytracker.com/id?1019393"
    },
    {
      "type": "WEB",
      "url": "http://wiki.rpath.com/Advisories:rPSA-2008-0052"
    },
    {
      "type": "WEB",
      "url": "http://wiki.rpath.com/wiki/Advisories:rPSA-2008-0052"
    },
    {
      "type": "WEB",
      "url": "http://www.debian.org/security/2008/dsa-1494"
    },
    {
      "type": "WEB",
      "url": "http://www.mandriva.com/security/advisories?name=MDVSA-2008:043"
    },
    {
      "type": "WEB",
      "url": "http://www.mandriva.com/security/advisories?name=MDVSA-2008:044"
    },
    {
      "type": "WEB",
      "url": "http://www.redhat.com/support/errata/RHSA-2008-0129.html"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/archive/1/488009/100/0/threaded"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/27704"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/27801"
    },
    {
      "type": "WEB",
      "url": "http://www.ubuntu.com/usn/usn-577-1"
    },
    {
      "type": "WEB",
      "url": "http://www.vupen.com/english/advisories/2008/0487/references"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-VV88-6C54-QWQ5

Vulnerability from github – Published: 2022-05-17 01:29 – Updated: 2022-05-17 01:29
VLAI
Details

reportbug before 6.4.4+deb7u1 and 6.5.x before 6.5.0+nmu1 allows remote attackers to execute arbitrary commands via vectors related to compare_versions and reportbug/checkversions.py.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2014-0479"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2014-08-06T19:55:00Z",
    "severity": "MODERATE"
  },
  "details": "reportbug before 6.4.4+deb7u1 and 6.5.x before 6.5.0+nmu1 allows remote attackers to execute arbitrary commands via vectors related to compare_versions and reportbug/checkversions.py.",
  "id": "GHSA-vv88-6c54-qwq5",
  "modified": "2022-05-17T01:29:11Z",
  "published": "2022-05-17T01:29:11Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2014-0479"
    },
    {
      "type": "WEB",
      "url": "https://bugs.launchpad.net/ubuntu/+source/reportbug/+bug/1353046"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/95149"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/59896"
    },
    {
      "type": "WEB",
      "url": "http://www.debian.org/security/2014/dsa-2997"
    },
    {
      "type": "WEB",
      "url": "http://www.osvdb.org/109858"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/69055"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-VV8H-M63V-53PQ

Vulnerability from github – Published: 2024-07-18 12:30 – Updated: 2025-02-13 20:23
VLAI
Summary
Apache StreamPark: FreeMarker SSTI RCE Vulnerability
Details

On versions before 2.1.4, a user could log in and perform a template injection attack resulting in Remote Code Execution on the server, The attacker must successfully log into the system to launch an attack, so this is a moderate-impact vulnerability.

Mitigation:

all users should upgrade to 2.1.4

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Maven",
        "name": "org.apache.streampark:streampark"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "2.1.4"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2024-29178"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2025-02-13T20:23:23Z",
    "nvd_published_at": "2024-07-18T12:15:02Z",
    "severity": "HIGH"
  },
  "details": "On versions before 2.1.4, a user could log in and perform a template injection attack resulting in Remote Code Execution on the server,\u00a0The attacker must successfully log into the system to launch an attack, so this is a moderate-impact vulnerability.\n\nMitigation:\n\nall users should upgrade to 2.1.4",
  "id": "GHSA-vv8h-m63v-53pq",
  "modified": "2025-02-13T20:23:23Z",
  "published": "2024-07-18T12:30:52Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-29178"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/apache/streampark"
    },
    {
      "type": "WEB",
      "url": "https://lists.apache.org/thread/n6dhnl68knpxy80t35qxkkw2691l8sfn"
    },
    {
      "type": "WEB",
      "url": "http://www.openwall.com/lists/oss-security/2024/07/18/1"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Apache StreamPark: FreeMarker SSTI RCE Vulnerability"
}

GHSA-VVF9-FXHV-4RGJ

Vulnerability from github – Published: 2022-05-24 16:52 – Updated: 2024-02-12 11:48
VLAI
Summary
Magento 2 Community Edition RCE
Details

A remote code execution vulnerability exists in Magento 2.1 prior to 2.1.18, Magento 2.2 prior to 2.2.9, Magento 2.3 prior to 2.3.2. An authenticated user with admin privileges to create or edit a product can execute arbitrary code via malicious XML layout updates.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "magento/community-edition"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "2.1.0"
            },
            {
              "fixed": "2.1.18"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "magento/community-edition"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "2.2.0"
            },
            {
              "fixed": "2.2.9"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "magento/community-edition"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "2.3.0"
            },
            {
              "fixed": "2.3.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2019-7942"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2023-07-14T23:20:20Z",
    "nvd_published_at": "2019-08-02T22:15:00Z",
    "severity": "HIGH"
  },
  "details": "A remote code execution vulnerability exists in Magento 2.1 prior to 2.1.18, Magento 2.2 prior to 2.2.9, Magento 2.3 prior to 2.3.2. An authenticated user with admin privileges to create or edit a product can execute arbitrary code via malicious XML layout updates.",
  "id": "GHSA-vvf9-fxhv-4rgj",
  "modified": "2024-02-12T11:48:00Z",
  "published": "2022-05-24T16:52:28Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2019-7942"
    },
    {
      "type": "WEB",
      "url": "https://github.com/FriendsOfPHP/security-advisories/blob/master/magento/product-community-edition/CVE-2019-7942.yaml"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/magento/magento2"
    },
    {
      "type": "WEB",
      "url": "https://magento.com/security/patches/magento-2.3.2-2.2.9-and-2.1.18-security-update-13"
    },
    {
      "type": "WEB",
      "url": "https://web.archive.org/web/20211206084839/https://magento.com/security/patches/magento-2.3.2-2.2.9-and-2.1.18-security-update-13"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.0/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Magento 2 Community Edition RCE"
}

GHSA-VVGJ-Q3Q8-C5GG

Vulnerability from github – Published: 2022-05-14 01:51 – Updated: 2025-04-12 12:44
VLAI
Details

The Extended Application Services (XS) in SAP HANA allows remote attackers to inject arbitrary ABAP code via unspecified vectors, aka SAP Note 2098906. NOTE: the provenance of this information is unknown; the details are obtained solely from third party information.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2015-1311"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2015-01-22T16:59:00Z",
    "severity": "HIGH"
  },
  "details": "The Extended Application Services (XS) in SAP HANA allows remote attackers to inject arbitrary ABAP code via unspecified vectors, aka SAP Note 2098906.  NOTE: the provenance of this information is unknown; the details are obtained solely from third party information.",
  "id": "GHSA-vvgj-q3q8-c5gg",
  "modified": "2025-04-12T12:44:38Z",
  "published": "2022-05-14T01:51:24Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2015-1311"
    },
    {
      "type": "WEB",
      "url": "https://erpscan.io/press-center/blog/sap-critical-patch-update-january-2015"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-VVJ8-288W-F65X

Vulnerability from github – Published: 2022-05-02 06:20 – Updated: 2022-05-02 06:20
VLAI
Details

Unspecified vulnerability in Microsoft Office Excel 2002 SP3 allows remote attackers to execute arbitrary code via an Excel file with a malformed RTD (0x813) record that triggers heap corruption, aka "Excel Memory Corruption Vulnerability," a different vulnerability than CVE-2010-0823 and CVE-2010-1249.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2010-1247"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2010-06-08T20:30:00Z",
    "severity": "HIGH"
  },
  "details": "Unspecified vulnerability in Microsoft Office Excel 2002 SP3 allows remote attackers to execute arbitrary code via an Excel file with a malformed RTD (0x813) record that triggers heap corruption, aka \"Excel Memory Corruption Vulnerability,\" a different vulnerability than CVE-2010-0823 and CVE-2010-1249.",
  "id": "GHSA-vvj8-288w-f65x",
  "modified": "2022-05-02T06:20:34Z",
  "published": "2022-05-02T06:20:34Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2010-1247"
    },
    {
      "type": "WEB",
      "url": "https://docs.microsoft.com/en-us/security-updates/securitybulletins/2010/ms10-038"
    },
    {
      "type": "WEB",
      "url": "https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A6630"
    },
    {
      "type": "WEB",
      "url": "http://osvdb.org/65237"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/archive/1/511754/100/0/threaded"
    },
    {
      "type": "WEB",
      "url": "http://www.us-cert.gov/cas/techalerts/TA10-159B.html"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-VVMH-47WP-9V36

Vulnerability from github – Published: 2022-05-13 01:33 – Updated: 2022-05-13 01:33
VLAI
Details

CX-Supervisor (Versions 3.42 and prior) can execute code that has been injected into a project file. An attacker could exploit this to execute code under the privileges of the application.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2018-19011"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2019-01-22T20:29:00Z",
    "severity": "HIGH"
  },
  "details": "CX-Supervisor (Versions 3.42 and prior) can execute code that has been injected into a project file. An attacker could exploit this to execute code under the privileges of the application.",
  "id": "GHSA-vvmh-47wp-9v36",
  "modified": "2022-05-13T01:33:37Z",
  "published": "2022-05-13T01:33:37Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2018-19011"
    },
    {
      "type": "WEB",
      "url": "https://ics-cert.us-cert.gov/advisories/ICSA-19-017-01"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/106654"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-VVMQ-FWMG-2GJC

Vulnerability from github – Published: 2022-05-16 18:13 – Updated: 2022-05-26 20:07
VLAI
Summary
Improper kubeconfig validation allows arbitrary code execution
Details

Flux2 can reconcile the state of a remote cluster when provided with a kubeconfig with the correct access rights. Kubeconfig files can define commands to be executed to generate on-demand authentication tokens. A malicious user with write access to a Flux source or direct access to the target cluster, could craft a kubeconfig to execute arbitrary code inside the controller’s container.

In multi-tenancy deployments this can also lead to privilege escalation if the controller's service account has elevated permissions.

Impact

Within the affected versions range, one of the permissions set below would be required for the vulnerability to be exploited: - Direct access to the cluster to create Flux Kustomization or HelmRelease objects and Kubernetes Secrets. - Direct access to the cluster to modify existing Kubernetes secrets being used as kubeconfig in existing Flux Kustomization or HelmRelease objects. - Direct access to the cluster to modify existing Flux Kustomization or HelmRelease objects and access to create or modify existing Kubernetes secrets. - Access rights to make changes to a configured Flux Source (i.e. Git repository).

Patches

This vulnerability was fixed in kustomize-controller v0.23.0 and helm-controller v0.19.0, both included in flux2 v0.29.0. Starting from the fixed versions, both controllers disable the use of command execution from kubeconfig files by default, users have to opt-in by adding the flag --insecure-kubeconfig-exec to the controller’s command arguments. Users are no longer allowed to refer to files in the controller’s filesystem in the kubeconfig files provided for the remote apply feature.

Workarounds

  • The functionality can be disabled via Validating Admission webhooks (e.g. OPA Gatekeeper, Kyverno) by restricting users from being able to set the spec.kubeConfig field in Flux Kustomization and HelmRelease objects.
  • Applying restrictive AppArmor and SELinux profiles on the controller’s pod to limit what binaries can be executed.

Credits

The Flux engineering team found and patched this vulnerability.

For more information

If you have any questions or comments about this advisory please open an issue in the flux2 repository.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/fluxcd/flux2"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.1.0"
            },
            {
              "fixed": "0.29.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/fluxcd/kustomize-controller"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.1.0"
            },
            {
              "fixed": "0.23.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/fluxcd/helm-controller"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.2.0"
            },
            {
              "fixed": "0.19.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2022-24817"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2022-05-16T18:13:51Z",
    "nvd_published_at": "2022-05-06T00:15:00Z",
    "severity": "CRITICAL"
  },
  "details": "Flux2 can reconcile the state of a remote cluster when provided with a [kubeconfig](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#file-references) with the correct access rights. `Kubeconfig` files can define [commands](https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins) to be executed to generate on-demand authentication tokens. A malicious user with write access to a Flux source or direct access to the target cluster, could craft a `kubeconfig` to execute arbitrary code inside the controller\u2019s container.\n\nIn multi-tenancy deployments this can also lead to privilege escalation if the controller\u0027s service account has elevated permissions.\n\n### Impact\n\nWithin the affected versions range, one of the permissions set below would be required for the vulnerability to be exploited:\n- Direct access to the cluster to create Flux `Kustomization` or `HelmRelease` objects and Kubernetes Secrets.\n- Direct access to the cluster to modify existing Kubernetes secrets being used as `kubeconfig` in existing Flux `Kustomization` or `HelmRelease` objects.\n- Direct access to the cluster to modify existing Flux `Kustomization` or `HelmRelease` objects and access to create or modify existing Kubernetes secrets.\n- Access rights to make changes to a configured Flux Source (i.e. Git repository).\n\n### Patches\n\nThis vulnerability was fixed in kustomize-controller [v0.23.0](https://github.com/fluxcd/kustomize-controller/releases/tag/v0.23.0) and helm-controller [v0.19.0](https://github.com/fluxcd/helm-controller/releases/tag/v0.19.0), both included in flux2 [v0.29.0](https://github.com/fluxcd/flux2/releases/tag/v0.29.0). Starting from the fixed versions, both controllers disable the use of command execution from `kubeconfig` files by default, users have to opt-in by adding the flag `--insecure-kubeconfig-exec` to the controller\u2019s command arguments. Users are no longer allowed to refer to files in the controller\u2019s filesystem in the `kubeconfig` files provided for the remote apply feature.\n\n### Workarounds\n\n- The functionality can be disabled via Validating Admission webhooks (e.g. OPA Gatekeeper, Kyverno) by restricting users from being able to set the `spec.kubeConfig` field in Flux `Kustomization` and `HelmRelease` objects.\n- Applying restrictive AppArmor and SELinux profiles on the controller\u2019s pod to limit what binaries can be executed.\n\n### Credits\n\nThe Flux engineering team found and patched this vulnerability.\n\n### For more information\n\nIf you have any questions or comments about this advisory please open an issue in the [flux2 repository](http://github.com/fluxcd/flux2).\n",
  "id": "GHSA-vvmq-fwmg-2gjc",
  "modified": "2022-05-26T20:07:54Z",
  "published": "2022-05-16T18:13:51Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/fluxcd/flux2/security/advisories/GHSA-vvmq-fwmg-2gjc"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-24817"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/fluxcd/flux2"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Improper kubeconfig validation allows arbitrary code execution"
}

Mitigation
Architecture and Design

Strategy: Refactoring

Refactor your program so that you do not have to dynamically generate code.

Mitigation
Architecture and Design
  • 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 MIT-5
Implementation

Strategy: Input Validation

  • 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().
Mitigation
Testing

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 MIT-32
Operation

Strategy: Compilation or Build Hardening

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 MIT-32
Operation

Strategy: Environment Hardening

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
Implementation

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].

CAPEC-242: Code Injection

An adversary exploits a weakness in input validation on the target to inject new code into that which is currently executing. This differs from code inclusion in that code inclusion involves the addition or replacement of a reference to a code file, which is subsequently loaded by the target and used as part of the code of some application.

CAPEC-35: Leverage Executable Code in Non-Executable Files

An attack of this type exploits a system's trust in configuration and resource files. When the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high.

CAPEC-77: Manipulating User-Controlled Variables

This attack targets user controlled variables (DEBUG=1, PHP Globals, and So Forth). An adversary can override variables leveraging user-supplied, untrusted query variables directly used on the application server without any data sanitization. In extreme cases, the adversary can change variables controlling the business logic of the application. For instance, in languages like PHP, a number of poorly set default configurations may allow the user to override variables.