Repository navigation
security: upgrade notebookjs and route ipynb HTML through DOMPurify - #8330
Merged
Merged
Conversation
unknwon
force-pushed
the
GHSA-6vxv-wg6j-5qwp
branch
from
June 7, 2026 01:44
99a0440 to
abd2698
Compare
unknwon
force-pushed
the
GHSA-6vxv-wg6j-5qwp
branch
from
June 7, 2026 01:49
abd2698 to
773e43f
Compare
notebookjs 0.4.2 built the rendered notebook by assigning marked.parse(source) to innerHTML on detached elements, so raw HTML in a markdown cell (e.g. <img onerror=...>) executed immediately, before the server-side sanitizer ever saw the document. Upgrade notebookjs to 0.8.3 and load DOMPurify alongside it. The new notebookjs pipes every innerHTML assignment through nb.sanitizer, which resolves to DOMPurify.sanitize at load time, so attacker HTML is neutralized before it can run. Drop the now-redundant client-side scheme filter and post-sanitize re-render from the view template. The relative-image-source prefixing is kept and moved to a direct DOM walk.
unknwon
force-pushed
the
GHSA-6vxv-wg6j-5qwp
branch
from
June 7, 2026 01:54
773e43f to
bf867f6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
notebookjs 0.4.2 builds the rendered notebook by assigning
marked.parse(source)toinnerHTMLon detached elements, so raw HTML in a markdown cell (e.g.<img onerror=...>) executes immediately, before the server-side sanitizer ever sees the document.Upgrade notebookjs to 0.8.3 and load DOMPurify alongside it. The new notebookjs pipes every
innerHTMLassignment throughnb.sanitizer, which resolves toDOMPurify.sanitizeat load time, so attacker HTML is neutralized before it can run.The now-redundant client-side scheme filter and post-sanitize re-render are removed from the view template. Relative image source prefixing is kept and moved to a direct DOM walk.
Advisory: GHSA-6vxv-wg6j-5qwp