{"answers":{"affected":"3 open source packages ship an affected version, including sqlfluff. It affects 1 product.","exploited":"There is no known exploitation of CVE-2023-36830 in the wild and no public exploit code.","fix":"Upgrade sqlfluff to 2.1.2 or later.","what":"CVE-2023-36830 is a medium-severity code injection vulnerability in sqlfluff, published on 6 Jul 2023. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2023-36830 and fix it if it is affected.\n\nWhat it is: CVE-2023-36830 is a medium-severity code injection vulnerability in sqlfluff, published on 6 Jul 2023. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2023-36830 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- sqlfluff (PyPI): affected all versions; fixed in 2.1.2\n- sqlfluff (PyPI): affected all versions; fixed in 2.1.2\n- sqlfluff (PyPI): affected all versions; fixed in 2.1.2\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2023-36830/ (Markdown: https://insights.sbomify.com/CVE-2023-36830/index.md)","id":"CVE-2023-36830","markdown":"https://insights.sbomify.com/CVE-2023-36830/index.md","name":"CVE-2023-36830","record":{"aliases":["DEBIAN-CVE-2023-36830","GHSA-jqhc-m2j3-fjrx","PYSEC-2023-111","UBUNTU-CVE-2023-36830"],"analysis":{"component_type":"developer_tool","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"adjacent_or_local","non_default_config":true,"product_category":"SQL linter","requires_auth":"low_privilege","summary":"Attackers with config file access can execute arbitrary Python code via the library_path setting in SQLFluff.","user_interaction":"not_required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"sqlfluff","vendor":"sqlfluff"}],"cvss":{"score":6.3,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:L","version":"3.1"},"cwes":[{"id":"CWE-74","name":"Improper Neutralization of Special Elements in Output Used by a Downstream Component"}],"description":"SQLFluff is a SQL linter. Prior to version 2.1.2, in environments where untrusted users have access to the config files, there is a potential security vulnerability where those users could use the `library_path` config value to allow arbitrary python code to be executed via macros. For many users who use SQLFluff in the context of an environment where all users already have fairly escalated privileges, this may not be an issue - however in larger user bases, or where SQLFluff is bundled into another tool where developers still wish to give users access to supply their on rule configuration, this may be an issue.\n\nThe 2.1.2 release offers the ability for the `library_path` argument to be overwritten on the command line by using the `--library-path` option. This overrides any values provided in the config files and effectively prevents this route of attack for users which have access to the config file, but not to the scripts which call the SQLFluff CLI directly. A similar option is provided for the Python API, where users also have a greater ability to further customise or override configuration as necessary. Unless `library_path` is explicitly required, SQLFluff maintainers recommend using the option `--library-path none` when invoking SQLFluff which will disable the `library-path` option entirely regardless of the options set in the configuration file or via inline config directives. As a workaround, limiting access to - or otherwise validating configuration files before they are ingested by SQLFluff will provides a similar effect and does not require upgrade.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"SQLFluff vulnerability for users with access to config file, using `library_path` to call arbitrary python code.","id":"CVE-2023-36830","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"code_injection","year":"2023"},"n_packages":3,"n_references":2,"next":{"headline":"Junos OS: SRX Series: jbuf memory leak when SSL Proxy and UTM Web-Filtering is applied","id":"CVE-2023-36831"},"packages":[{"ecosystem":"PyPI","fixed":["2.1.2"],"introduced":["0"],"last_affected":[],"package":"sqlfluff","purl":null,"source":"GHSA-jqhc-m2j3-fjrx"},{"ecosystem":"PyPI","fixed":["2.1.2"],"introduced":["0"],"last_affected":[],"package":"sqlfluff","purl":"pkg:pypi/sqlfluff","source":"GHSA-jqhc-m2j3-fjrx"},{"ecosystem":"PyPI","fixed":["2.1.2"],"introduced":["0"],"last_affected":[],"package":"sqlfluff","purl":"pkg:pypi/sqlfluff","source":"PYSEC-2023-111"}],"prev":{"headline":"Sentry CORS misconfiguration vulnerability","id":"CVE-2023-36829"},"products":["sqlfluff"],"published":"2023-07-06","related":[{"cvss_score":7.5,"headline":"SQLFluff: Recursive Stack Overflow in Parser","id":"CVE-2026-46373","kev_date_added":null,"published":"2026-06-09"},{"cvss_score":7.5,"headline":"SQLFluff: Uncontrolled Resource Consumption in Parser","id":"CVE-2026-46374","kev_date_added":null,"published":"2026-06-09"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2024-10-18","vendors":["sqlfluff"]},"summary":"Attackers with config file access can execute arbitrary Python code via the library_path setting in SQLFluff.","url":"https://insights.sbomify.com/CVE-2023-36830/"}