{"id":"CVE-2023-23619","aliases":["CVE-2023-23619","GHSA-4jg2-84c2-pj95"],"related":[],"kind":"vulnerability","state":"published","title":"Improper Control of Generation of Code ('Code Injection') in @asyncapi/modelina","summary":"Modelina is a library for generating data models based on inputs such as AsyncAPI, OpenAPI, or JSON Schema documents. Versions prior to 1.0.0 are vulnerable to Code injection. This issue affects anyone who is using the default presets and/or does not handle the functionality themself. This issue has been partially mitigated in version 1.0.0, with the maintainer's GitHub Security Advisory (GHSA) noting \"It is impossible to fully guard against this, because users have access to the original raw information. However, as of version 1, if you only access the constrained models, you will not encounter this issue. Further similar situations are NOT seen as a security issue, but intended behavior.\" The suggested workaround from the maintainers is \"Fully custom presets that change the entire rendering process which can then escape the user input.\"","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Modelina is a library for generating data models based on inputs such as AsyncAPI, OpenAPI, or JSON Schema documents. Versions prior to 1.0.0 are vulnerable to Code injection. This issue affects anyone who is using the default presets and/or does not handle the functionality themself. This issue has been partially mitigated in version 1.0.0, with the maintainer's GitHub Security Advisory (GHSA) noting \"It is impossible to fully guard against this, because users have access to the original raw information. However, as of version 1, if you only access the constrained models, you will not encounter this issue. Further similar situations are NOT seen as a security issue, but intended behavior.\" The suggested workaround from the maintainers is \"Fully custom presets that change the entire rendering process which can then escape the user input.\"","source":"cvelist"},{"lang":"en","text":"### Impact\nAnyone who is using the default presets and/or does not handle the functionality themself.\n\n### Patches\nIt is impossible to fully guard against this, because users have access to the original raw information. However, as of version 1, if you only access the constrained models, you will not encounter this issue.\n\nFurther similar situations are NOT seen as a security issue, but intended behavior.\n\n### Workarounds\nFully custom presets that change the entire rendering process which can then escape the user input.\n\n### For more information\nEven though that I changed all the presets here, the vulnerability is still present throughout. I am using a JSON Schema here for simplicity.\n```ts\nconst jsonSchemaDoc = {\n  $id: 'CustomClass',\n  type: 'object',\n  properties: {\n      'property: any; \\n constructor(){console.log(\"injected\")} \\n private _temp': { type: 'string' },\n  }\n};\ngenerator = new TypeScriptGenerator(\n  { \n    presets: [\n      {\n        class: {\n            property({ propertyName, content }) {\n              return `private ${propertyName}: any;`;\n            },\n            ctor() {\n              return '';\n            },\n            getter() {\n              return '';\n            },\n            setter() {\n              return '';\n            }\n        }\n      }\n    ]\n  }\n);\nconst inputModel = await generator.process(jsonSchemaDoc);\n```\nThis would render\n```ts\nexport class CustomClass {\n  private property: any; \n   constructor(){console.log(\"injected\")} \n   private _temp: any;\n  private additionalProperties: any;\n}\n```","format":"markdown","source":"ghsa"},{"lang":"es","text":"Modelina es una librería para generar modelos de datos basados en entradas como documentos AsyncAPI, OpenAPI o JSON Schema. Las versiones anteriores a la 1.0.0 son vulnerables a la inyección de código. Este problema afecta a cualquiera que utilice los ajustes preestablecidos predeterminados y/o no maneje la funcionalidad por sí mismo. Este problema se ha mitigado parcialmente en la versión 1.0.0, y el GitHub Security Advisory (GHSA) del fabricante señala: \"Es imposible protegerse completamente contra esto, porque los usuarios tienen acceso a la información sin procesar original. Sin embargo, a partir de la versión 1, si solo accede a los modelos restringidos, no encontrará este problema. Otras situaciones similares NO se consideran un problema de seguridad, sino un comportamiento previsto\". La solución sugerida por los fabricantees es \"Preajustes totalmente personalizados que cambian todo el proceso de renderizado y luego pueden escapar de la entrada del usuario\".","source":"nvd"}],"published":"2021-09-21T18:41:59.000Z","modified":"2026-09-10T03:49:27.247Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":10,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":10,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":9.9,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"}],"cwes":["CWE-94"],"affected":[{"ranges":[{"version":"< 1.0.0","status":"affected"}],"vendor":"asyncapi","product":"modelina","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.0.0"}],"ecosystem":"npm","package":"@asyncapi/modelina","purl":"pkg:npm/%40asyncapi/modelina","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.0.0"}],"vendor":"lfprojects","product":"modelina","cpe":"cpe:2.3:a:lfprojects:modelina:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/asyncapi/modelina/security/advisories/GHSA-4jg2-84c2-pj95","tags":["exploit","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-23619","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/asyncapi/modelina","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2025-03-10T21:01:00.504Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-23619","url":"https://www.cve.org/CVERecord?id=CVE-2023-23619","licence":"CVE Terms of Use","modified":"2025-03-10T21:19:14.012Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-4jg2-84c2-pj95","url":"https://github.com/advisories/GHSA-4jg2-84c2-pj95","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:27.247Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-23619","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-23619","licence":"Public domain","modified":"2026-06-17T05:37:35.933Z"}],"updatedAt":"2026-11-25T22:58:21.731Z","epss":{"score":0.01085,"percentile":0.6487,"date":"2026-11-30T12:00:22.000Z"}}