# CVE-2025-58765: wabac.js has XSS vulnerability in 404 error handling logic

> Attackers can execute arbitrary JavaScript in victims' browsers via reflected XSS in wabac.js 404 error handling, requiring an upgrade to fix.

- **Severity:** High 7.1 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 9 Sep 2025
- **Updated:** 10 Sep 2025
- **Also known as:** GHSA-w765-jm6w-4hhj

## What is CVE-2025-58765?

CVE-2025-58765 is a high-severity cross-site scripting vulnerability in webrecorder wabac.js, published on 9 Sep 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

wabac.js provides a full web archive replay system, or 'wayback machine', using Service Workers. A Reflected Cross-Site Scripting (XSS) vulnerability exists in the 404 error handling logic of wabac.js v2.23.10 and below. The parameter `requestURL` (derived from the original request target) is directly embedded into an inline `<script>` block without sanitization or escaping. This allows an attacker to craft a malicious URL that executes arbitrary JavaScript in the victim’s browser. The scope may be limited by CORS policies, depending on the situation in which wabac.js is used. The vulnerability is fixed in wabac.js v2.23.11.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation)

## Which versions are affected by CVE-2025-58765?

6 open source packages ship an affected version, including @webrecorder/archivewebpage, @webrecorder/wabac and replaywebpage.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@webrecorder/archivewebpage` | npm | All versions | 0.15.4 |
| `@webrecorder/archivewebpage` | npm | All versions | 0.15.4 |
| `@webrecorder/wabac` | npm | All versions | 2.23.11 |
| `@webrecorder/wabac` | npm | All versions | 2.23.11 |
| `replaywebpage` | npm | All versions | 2.3.17 |
| `replaywebpage` | npm | All versions | 2.3.17 |

## How do I fix CVE-2025-58765?

Upgrade @webrecorder/archivewebpage to 0.15.4 or later.

## Is CVE-2025-58765 being exploited?

There is no known exploitation of CVE-2025-58765 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-58765 and fix it if it is affected.

What it is: CVE-2025-58765 is a high-severity cross-site scripting vulnerability in webrecorder wabac.js, published on 9 Sep 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2025-58765 in the wild and no public exploit code.

Affected packages and fixed versions:
- @webrecorder/archivewebpage (npm): affected all versions; fixed in 0.15.4
- @webrecorder/archivewebpage (npm): affected all versions; fixed in 0.15.4
- @webrecorder/wabac (npm): affected all versions; fixed in 2.23.11
- @webrecorder/wabac (npm): affected all versions; fixed in 2.23.11
- replaywebpage (npm): affected all versions; fixed in 2.3.17
- replaywebpage (npm): affected all versions; fixed in 2.3.17

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-2025-58765/ (Markdown: https://insights.sbomify.com/CVE-2025-58765/index.md)
```

## Sources

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

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