# GHSA-fwfx-rrv8-crpf: op_panic in the base runtime can force a panic in the runtime's containing thread

> An exposed panic operation in the Deno core library allows attackers to crash the host thread, causing a denial of service.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 18 Jul 2024
- **Also known as:** RUSTSEC-2024-0405

## What is GHSA-fwfx-rrv8-crpf?

GHSA-fwfx-rrv8-crpf is a denial of service vulnerability in rustyscript, published on 18 Jul 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Affected versions use deno_core releases that expose `Deno.core.ops.op_panic` to the JS runtime in the base core

This function when called triggers a manual panic in the thread containing the runtime.

It can be fixed by stubbing out the exposed op:
```javascript
Deno.core.ops.op_panic = (msg) => { throw new Error(msg) };
```

## Which versions are affected by GHSA-fwfx-rrv8-crpf?

3 open source packages ship an affected version, including rustyscript.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `rustyscript` | crates.io | From 0.3.1-0 | 0.6.1 |
| `rustyscript` | crates.io | From 0.4.0 | 0.6.1 |
| `rustyscript` | crates.io | From 0.4.0 | 0.6.1 |

## How do I fix GHSA-fwfx-rrv8-crpf?

Upgrade rustyscript to 0.6.1 or later.

## Is GHSA-fwfx-rrv8-crpf being exploited?

There is no known exploitation of GHSA-fwfx-rrv8-crpf in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-fwfx-rrv8-crpf and fix it if it is affected.

What it is: GHSA-fwfx-rrv8-crpf is a denial of service vulnerability in rustyscript, published on 18 Jul 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-fwfx-rrv8-crpf in the wild and no public exploit code.

Affected packages and fixed versions:
- rustyscript (crates.io): affected from 0.3.1-0; fixed in 0.6.1
- rustyscript (crates.io): affected from 0.4.0; fixed in 0.6.1
- rustyscript (crates.io): affected from 0.4.0; fixed in 0.6.1

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/GHSA-fwfx-rrv8-crpf/ (Markdown: https://insights.sbomify.com/GHSA-fwfx-rrv8-crpf/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-fwfx-rrv8-crpf

---
From sbomify Insights: https://insights.sbomify.com/GHSA-fwfx-rrv8-crpf/
Summaries are generated and may contain mistakes; the official description above is the record.
