# CVE-2025-23205: `frame-ancestors: self` grants all users access to formgrader in nbgrader

> Attackers can steal grading data from authorized users by exploiting frame-ancestors settings in nbgrader when subdomains are disabled.

- **Severity:** Medium 6.9 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 17 Jan 2025
- **Updated:** 6 Feb 2025
- **Also known as:** GHSA-fcr8-4r9f-r66m, PYSEC-2026-1692

## What is CVE-2025-23205?

CVE-2025-23205 is a medium-severity vulnerability in jupyter nbgrader, published on 17 Jan 2025. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

### Official description

nbgrader is a system for assigning and grading notebooks. Enabling frame-ancestors: 'self' grants any JupyterHub user the ability to extract formgrader content by sending malicious links to users with access to formgrader, at least when using the default JupyterHub configuration of `enable_subdomains = False`. #1915 disables a protection which would allow user Alice to craft a page embedding formgrader in an IFrame. If Bob visits that page, his credentials will be sent and the formgrader page loaded. Because Alice's page is on the same Origin as the formgrader iframe, Javasript on Alice's page has _full access_ to the contents of the page served by formgrader using Bob's credentials. This issue has been addressed in release 0.9.5 and all users are advised to upgrade. Users unable to upgrade may disable `frame-ancestors: self`, or enable per-user and per-service subdomains with `JupyterHub.enable_subdomains = True` (then even if embedding in an IFrame is allowed, the host page does not have access to the contents of the frame).

Weakness: CWE-668 (Exposure of Resource to Wrong Sphere)

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

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `nbgrader` | PyPI | From 0.9.4 | 0.9.5 |
| `nbgrader` | PyPI | From 0.9.4 | 0.9.5 |
| `nbgrader` | PyPI | From 0.9.4 | 0.9.5 |

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

Upgrade nbgrader to 0.9.5 or later.

## Is CVE-2025-23205 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2025-23205 is a medium-severity vulnerability in jupyter nbgrader, published on 17 Jan 2025. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2025-23205 in the wild and no public exploit code.

Affected packages and fixed versions:
- nbgrader (PyPI): affected from 0.9.4; fixed in 0.9.5
- nbgrader (PyPI): affected from 0.9.4; fixed in 0.9.5
- nbgrader (PyPI): affected from 0.9.4; fixed in 0.9.5

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

## Sources

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

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