# CVE-2023-23619: Improper Control of Generation of Code ('Code Injection') in @asyncapi/modelina

> Attackers can inject malicious code via input documents in Modelina, potentially executing arbitrary code on systems using default presets.

- **Severity:** Critical 10.0 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 26 Jan 2023
- **Updated:** 10 Mar 2025
- **Also known as:** GHSA-4jg2-84c2-pj95

## What is CVE-2023-23619?

CVE-2023-23619 is a critical code injection vulnerability in asyncapi modelina, published on 26 Jan 2023. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

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

Weakness: CWE-94 (Improper Control of Generation of Code)

## Which versions are affected by CVE-2023-23619?

2 open source packages ship an affected version, including @asyncapi/modelina. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@asyncapi/modelina` | npm | All versions | 1.0.0 |
| `@asyncapi/modelina` | npm | All versions | 1.0.0 |

Products: Lfprojects Modelina.

## How do I fix CVE-2023-23619?

Upgrade @asyncapi/modelina to 1.0.0 or later.

## Is CVE-2023-23619 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-23619 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-23619 and fix it if it is affected.

What it is: CVE-2023-23619 is a critical code injection vulnerability in asyncapi modelina, published on 26 Jan 2023. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-23619 exists.

Affected packages and fixed versions:
- @asyncapi/modelina (npm): affected all versions; fixed in 1.0.0
- @asyncapi/modelina (npm): affected all versions; fixed in 1.0.0

Task:
1. 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.
2. 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.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-23619/ (Markdown: https://insights.sbomify.com/CVE-2023-23619/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-23619
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-23619
- OSV: https://osv.dev/vulnerability/CVE-2023-23619

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-23619/
Summaries are generated and may contain mistakes; the official description above is the record.
