{"id":"GHSA-vh9h-29pq-r5m8","revision":null,"records":[{"revision":"228553b81a7d4a418cd7ddd62466282f","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-32304","aliases":[],"title":"Locutus: RCE via unsanitized input in create_function()","description":"Locutus brings stdlibs of other programming languages to JavaScript for educational purposes. Prior to 3.0.14, the create_function(args, code) function passes both parameters directly to the Function constructor without any sanitization, allowing arbitrary code execution. This is distinct from CVE-2026-29091 which was call_user_func_array using eval() in v2.x. This finding affects create_function using new Function() in v3.x. This vulnerability is fixed in 3.0.14.","state":0,"publishedAt":"2026-03-12T21:24:51.73+00:00","modifiedAt":"2026-07-15T01:08:07.107+00:00","affected":[{"ecosystem":"Vendor product","name":"locutus","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"locutusjs\",\n                    \"product\": \"locutus\",\n                    \"versions\": [\n                        {\n                            \"version\": \"< 3.0.14\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"severity":"CRITICAL"}],"references":["https://github.com/locutusjs/locutus/security/advisories/GHSA-vh9h-29pq-r5m8","https://github.com/locutusjs/locutus/releases/tag/v3.0.14"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-32304","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-32304","identifiers":["CVE-2026-32304"]},"retained":false,"historicalAffected":[]},{"revision":"d1b0f6db255b4b049177f809dcdb6d6b","observedAt":"2026-11-23T15:27:19.786+00:00","statement":{"source":"euvd","id":"EUVD-2026-11718","aliases":["CVE-2026-32304","GHSA-vh9h-29pq-r5m8"],"title":"Locutus brings stdlibs of other programming languages to JavaScript for educational purposes. Prior to 3.0.14, the create_function(args, code) function passes both parameters directly to the Function constructor without any sanitization, al…","description":"Locutus brings stdlibs of other programming languages to JavaScript for educational purposes. Prior to 3.0.14, the create_function(args, code) function passes both parameters directly to the Function constructor without any sanitization, allowing arbitrary code execution. This is distinct from CVE-2026-29091 which was call_user_func_array using eval() in v2.x. This finding affects create_function using new Function() in v3.x. This vulnerability is fixed in 3.0.14.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"severity":null}],"references":["https://github.com/locutusjs/locutus/security/advisories/GHSA-vh9h-29pq-r5m8","https://github.com/locutusjs/locutus/releases/tag/v3.0.14"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-11718","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Mar 12, 2026, 9:24:51 PM","dateUpdated":"Jul 15, 2026, 1:08:07 AM"},"relatedAdvisories":[],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2026-11718","identifiers":["EUVD-2026-11718","CVE-2026-32304","GHSA-vh9h-29pq-r5m8"]},"retained":false,"historicalAffected":[]},{"revision":"e5355a087cee450890dd5f5ee07ddb63","observedAt":"2026-10-25T07:19:20.959+00:00","statement":{"source":"nvd","id":"CVE-2026-32304","aliases":[],"title":"Locutus brings stdlibs of other programming languages to JavaScript for educational purposes. Prior to 3.0.14, the create_function(args, code) function passes both parameters directly to the Function constructor without any sanitization, al…","description":"Locutus brings stdlibs of other programming languages to JavaScript for educational purposes. Prior to 3.0.14, the create_function(args, code) function passes both parameters directly to the Function constructor without any sanitization, allowing arbitrary code execution. This is distinct from CVE-2026-29091 which was call_user_func_array using eval() in v2.x. This finding affects create_function using new Function() in v3.x. This vulnerability is fixed in 3.0.14.","state":0,"publishedAt":"2026-03-13T19:54:41.83+00:00","modifiedAt":"2026-07-15T02:19:58.393+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · security-advisories@github.com · Secondary","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"severity":"CRITICAL"},{"system":"CVSS 3.1 · 0b0ca135-0b70-47e7-9f44-1890c2a1c46c · Secondary","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.5,"severity":"HIGH"}],"references":["https://github.com/locutusjs/locutus/releases/tag/v3.0.14","https://github.com/locutusjs/locutus/security/advisories/GHSA-vh9h-29pq-r5m8","https://access.redhat.com/security/cve/CVE-2026-32304","https://bugzilla.redhat.com/show_bug.cgi?id=2447200","https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-32304.json"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-32304","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Modified","weaknesses":["CWE-94","CWE-88"],"productCriteria":["cpe:2.3:a:locutus:locutus:*:*:*:*:*:node.js:*:*"],"sourceDates":{"published":"2026-03-13T19:54:41.830","lastModified":"2026-07-15T02:19:58.393"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-32304","identifiers":["CVE-2026-32304"]},"retained":false,"historicalAffected":[]},{"revision":"cd15a4a8b5ec45c4ba43bddaa6f77591","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-vh9h-29pq-r5m8","aliases":["CVE-2026-32304"],"title":"Locutus vulnerable to RCE via unsanitized input in create_function()","description":"## Summary\n\nThe `create_function(args, code)` function passes both parameters directly to the `Function` constructor without any sanitization, allowing arbitrary code execution.\n\nThis is distinct from CVE-2026-29091 (GHSA-fp25-p6mj-qqg6) which was `call_user_func_array` using `eval()` in v2.x. This finding affects `create_function` using `new Function()` in v3.x.\n\n## Root Cause\n\n`src/php/funchand/create_function.ts:17`:\n```typescript\nreturn new Function(...params, code)\n```\n\nZero input validation on either parameter.\n\n## PoC\n\n```javascript\nconst { create_function } = require('locutus/php/funchand/create_function');\nconst rce = create_function('', 'return require(\"child_process\").execSync(\"id\").toString()');\nconsole.log(rce());\n// Output: uid=501(user) gid=20(staff) ...\n```\n\nConfirmed on locutus v3.0.11, Node.js v24.13.1.\n\n## Impact\n\nFull RCE when an attacker can control either argument to `create_function()`. 597K weekly npm downloads.\n\n## Suggested Fix\n\nRemove `create_function` or replace `new Function()` with a safe alternative. PHP itself deprecated `create_function()` in PHP 7.2 for the same reason.\n\n## Response\n\nThanks for the report.\n\nWe confirmed that `php/funchand/create_function` was still present through `locutus@3.0.13` and that it exposed dynamic code execution via `new Function(...)`.\n\nWhile this was intended behavior, `create_function()` inherently needs to be unsafe in order for it to work, `create_function()` was deprecated in PHP 7.2 and removed in PHP 8.0. Given that Locutus' parity target today is 8.3, this function shouldn't have been in Locutus at all anymore.\n\nWe fixed this in `locutus@3.0.14` by removing `php/funchand/create_function` entirely. That matches our PHP 8.3 parity target more closely: . \n\nWe also updated `php/var/var_export` so closures now export using the PHP 8-style `\\Closure::__set_state(array(...))` form instead of referencing the removed API.\n\nRelease:\n- npm: `locutus@3.0.14`\n- GitHub release: https://github.com/locutusjs/locutus/releases/tag/v3.0.14\n\nCredit to @ByamB4 for the report.","state":0,"publishedAt":"2026-03-13T16:10:29+00:00","modifiedAt":"2026-03-16T17:16:36.965889+00:00","affected":[{"ecosystem":"npm","name":"locutus","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"3.0.14"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"CRITICAL"}],"references":["https://github.com/locutusjs/locutus/security/advisories/GHSA-vh9h-29pq-r5m8","https://nvd.nist.gov/vuln/detail/CVE-2026-32304","https://github.com/locutusjs/locutus","https://github.com/locutusjs/locutus/releases/tag/v3.0.14"],"sourceUrl":"https://github.com/advisories/GHSA-vh9h-29pq-r5m8","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-vh9h-29pq-r5m8","identifiers":["GHSA-vh9h-29pq-r5m8","CVE-2026-32304"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-24T19:24:56.8737941+00:00","complete":true,"records":1795,"lastAttemptAt":"2026-11-24T19:24:56.8737941+00:00","lastSuccessAt":"2026-11-24T19:24:57.2988051+00:00","error":null,"lastVerifiedAt":"2026-11-24T19:24:57.2988062+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-f6e4a7f93ed9acd6fcb1f804a4567f7b9b16730ac126110af8d6d24176317946-1affdc145f6b69b3c45f26e7200d5494d56b596b8a589028378609bf055cbdf9","complete":true,"records":431700,"lastAttemptAt":"2026-11-24T19:24:56.246467+00:00","lastSuccessAt":"2026-11-24T19:24:56.0174093+00:00","error":null,"lastVerifiedAt":"2026-11-24T19:24:56.246467+00:00","snapshotPublishedAt":"2026-11-24T19:22:54+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-688c786e0e154f0aa5ebda26bfba5e3a","complete":false,"records":13935,"lastAttemptAt":"2026-11-24T19:25:03.409988+00:00","lastSuccessAt":"2026-11-24T19:05:48.266+00:00","error":"94 identifier lookups failed; latest failures include AccessDenied (HTTP 403). Other identifiers were checked independently.","lastVerifiedAt":"2026-11-24T19:05:48.266+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13877,"expectedIdentifiers":13982,"failedIdentifiers":94},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-24T19:24:56.8737941+00:00","complete":true,"records":1131,"lastAttemptAt":"2026-11-24T19:24:56.8737941+00:00","lastSuccessAt":"2026-11-24T19:24:57.3217986+00:00","error":null,"lastVerifiedAt":"2026-11-24T19:24:57.3218003+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-a4d3d64b93df4d1da3938d27196fcba8","complete":true,"records":13947,"lastAttemptAt":"2026-11-24T19:25:01.6355516+00:00","lastSuccessAt":"2026-11-24T19:04:25.935+00:00","error":null,"lastVerifiedAt":"2026-11-24T19:04:25.935+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13982,"expectedIdentifiers":13982,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-4929b8b852ac0d08034af08eb3f8801ac97c81d230bedb3a3a0710d6b4e692b2","complete":true,"records":10074,"lastAttemptAt":"2026-11-24T19:24:56.6850757+00:00","lastSuccessAt":"2026-11-24T18:03:57.9682362+00:00","error":null,"lastVerifiedAt":"2026-11-24T19:24:56.6850757+00:00","snapshotPublishedAt":"2026-11-24T17:33:45+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-6ba2352decd0c95d34a1b50f642582aa34659ce946f552488f0a5cea4e0cc09a","complete":true,"records":2020,"lastAttemptAt":"2026-11-24T19:24:56.4707087+00:00","lastSuccessAt":"2026-11-20T15:46:15.4249619+00:00","error":null,"lastVerifiedAt":"2026-11-24T19:24:56.4707087+00:00","snapshotPublishedAt":"2026-11-20T14:48:20+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-3afd4dd07a6bf352a6a53c4438150c464a2527017b95ca94804134ea15f1eba9","complete":true,"records":3220,"lastAttemptAt":"2026-11-24T19:24:56.7893892+00:00","lastSuccessAt":"2026-11-24T10:25:37.8779609+00:00","error":null,"lastVerifiedAt":"2026-11-24T19:24:56.7893892+00:00","snapshotPublishedAt":"2026-11-24T09:33:40+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-44152768b3aabd79974e12387f59fcbffd2373284eb946ae9e13df00d985abde","complete":true,"records":233039,"lastAttemptAt":"2026-11-24T19:24:56.5789855+00:00","lastSuccessAt":"2026-11-24T19:03:58.5695229+00:00","error":null,"lastVerifiedAt":"2026-11-24T19:24:56.5789855+00:00","snapshotPublishedAt":"2026-11-24T18:33:49+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}