Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2025-23205 Overview
CVE-2025-23205 affects nbgrader, a Jupyter-based system for assigning and grading notebooks. The vulnerability stems from a Content-Security-Policy directive of frame-ancestors: 'self' that allows any JupyterHub user to embed the formgrader interface in an IFrame hosted on their own user origin. When a privileged formgrader user visits a crafted page, their credentials load the formgrader content, and JavaScript on the attacker page gains full access to the frame contents. The issue applies to default JupyterHub deployments where enable_subdomains = False. The flaw is tracked as an information exposure through cross-boundary sharing issue [CWE-668].
Critical Impact
Any authenticated JupyterHub user can extract formgrader content, including student grades and submissions, by luring a grader to a malicious link.
Affected Products
- nbgrader versions prior to 0.9.5
- JupyterHub deployments with enable_subdomains = False (default)
- Multi-user formgrader configurations shipped in the nbgrader demos
Discovery Timeline
- 2025-01-17 - CVE-2025-23205 published to the National Vulnerability Database
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2025-23205
Vulnerability Analysis
nbgrader relaxed its Content-Security-Policy headers in pull request #1915, setting frame-ancestors: 'self'. In JupyterHub without per-user subdomains, every user is served from the same Origin as the formgrader service. The directive therefore treats attacker-controlled user pages as same-origin frame ancestors.
An attacker (user Alice) can host a page that embeds formgrader in an <iframe>. When a grader (user Bob) visits the page, the browser issues the framed request with Bob's JupyterHub session cookies. The formgrader response renders inside the IFrame. Because Alice's page and the IFrame share the same Origin, the Same-Origin Policy does not block cross-frame DOM access.
The result is a hybrid clickjacking and cross-site data exfiltration primitive. Attacker JavaScript reads the full DOM of formgrader, including student rosters, grades, and feedback, and can exfiltrate the content to an external endpoint.
Root Cause
The root cause is misconfigured frame-ancestor trust. frame-ancestors: 'self' assumes a one-to-one mapping between origin and trust boundary. JupyterHub's default routing places all users on a single origin, so 'self' includes every peer user rather than only the formgrader service itself.
Attack Vector
Exploitation requires network access to the JupyterHub instance, an authenticated low-privilege user account, and a target grader clicking a malicious link. The attack vector is network-based with user interaction, and the impact is confidentiality loss on formgrader data.
# Patch applied in demos/demo_multiple_classes/jupyter_server_config.py
# Reverts PR #1915 and restores the restrictive frame-ancestors policy
c = get_config()
c.ServerApp.tornado_settings = {}
c.ServerApp.tornado_settings["headers"] = {
"Content-Security-Policy": "frame-ancestors 'self'"
}
Source: GitHub Commit 73e1375. The 0.9.5 release reverts the permissive change and reasserts the restrictive policy together with guidance to enable per-user subdomains for complete isolation.
Detection Methods for CVE-2025-23205
Indicators of Compromise
- Unexpected formgrader HTTP requests whose Referer header points to another JupyterHub user path such as /user/<attacker>/....
- Outbound requests from a grader's browser to third-party domains shortly after loading a peer user page.
- Grader session activity on formgrader endpoints without corresponding navigation events in access logs.
Detection Strategies
- Review JupyterHub proxy and Jupyter server logs for formgrader endpoints loaded with cross-user Referer or Origin headers.
- Inspect served responses for a Content-Security-Policy header missing the frame-ancestors directive, which indicates the vulnerable configuration is still active.
- Compare the installed nbgrader package version against 0.9.5 across all hub nodes using pip show nbgrader.
Monitoring Recommendations
- Alert on new or modified jupyter_server_config.py files that override Content-Security-Policy headers.
- Monitor for formgrader usage patterns that deviate from known grader accounts, such as access from unusual client IPs or browsers.
- Track JupyterHub audit logs for session reuse across short time windows involving distinct user paths.
How to Mitigate CVE-2025-23205
Immediate Actions Required
- Upgrade nbgrader to version 0.9.5 or later on every hub, grader, and class server.
- Audit all jupyter_server_config.py files to confirm the restrictive frame-ancestors policy is restored after upgrade.
- Instruct graders to avoid clicking links to other users' JupyterHub paths until the fix is deployed.
Patch Information
The fix is released in nbgrader 0.9.5. The patch reverts pull request #1915 and reinstates Content-Security-Policy: frame-ancestors 'self' in the demo server configurations. Review the GitHub Security Advisory GHSA-fcr8-4r9f-r66m and the GitHub Pull Request Discussion for complete remediation details.
Workarounds
- Remove the frame-ancestors: 'self' directive and replace it with frame-ancestors: 'none' to block all framing of formgrader.
- Enable per-user and per-service subdomains by setting JupyterHub.enable_subdomains = True, which places each user on a distinct origin and restores Same-Origin Policy isolation even if framing is permitted.
- Restrict formgrader access to a dedicated hub or network segment that is not shared with general JupyterHub users.
# Mitigation: enable per-user subdomains in jupyterhub_config.py
# This isolates each user and service on a distinct origin
c.JupyterHub.enable_subdomains = True
# Alternative: block all framing of formgrader in jupyter_server_config.py
c.ServerApp.tornado_settings = {
"headers": {
"Content-Security-Policy": "frame-ancestors 'none'"
}
}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

