CVE-2026-102830: JupyterLab: Cross-site scripting (XSS) in JupyterLab via crafted language package (jupyterlab.json)
Description
A language pack ships a Plural-Forms header saying how the language counts, for example nplurals=2; plural=(n != 1);. JupyterLab turns that string into a function with new Function, so the header gets executed. The check that meant to keep it safe was a regular expression. The regex was anchored at the start but not at the end, so it accepted any string that began with a valid plural rule and ignored everything after it.
A header such as the following passed the check, and the part after the plural rule ran in the JupyterLab page as soon as the first plural string was translated:
nplurals=2; plural=(n > 1); <anything here ran as JavaScript>
Users are affected if all of the following are true:
- they run JupyterLab 3.0.0 through 4.6.3, or an application that bundles it such as Notebook 7; - a language pack they did not write is installed in the environment; and - that language is selected, so its catalogue is loaded
An installation using the default English locale loads no catalogue and is not affected.
CVE assignment pending, GitHub CNA is experiencing severe backlog
Impact
The code in the header ran in the JupyterLab page, in the same origin and session as the authenticated user. It could call the Jupyter Server REST API as that user: read and write any file under the server root, start a kernel and run code in it, and open a terminal where terminals are enabled. Nothing had to be clicked; translating one plural string was enough, and that happens during normal use of the interface.
What this changes is who has to be trusted. A language pack is a Python package, and installing one is already a privileged act, so an attacker who can get any package installed has server-side code execution regardless of this issue. The header is different because it is catalogue metadata: it travels with translation content, through the translation pipeline that carries strings from Crowdin into the language packs, and it is reviewed as text rather than as code. Anyone able to change a catalogue, or to publish a pack under a name someone installs, got JavaScript execution in every browser that selected that language.
Note: the impact is much more limited on JupyterLite which typically does not have access to most of the surfaces that this flaw exposes.
Patches
JupyterLab v4.6.4 and v4.5.11 contain the patch. The check now has to match the whole header, so a plural rule followed by anything else is rejected and no function is built from it.
JupyterLab 3.x reached end of life and receives no patch. Its users should move to a supported 4.x release.
Users of applications that depend on JupyterLab, such as Notebook v7+, should update jupyterlab package too.
Workarounds
Use the English locale, which loads no catalogue:
bash jupyter lab --LabApp.defaultlocale=en
or the following traitlet:
python c.LabApp.defaultlocale = 'en'
Everyone then sees the interface in English, whatever language they had selected.
To check what is installed instead of switching, report any pack whose header carries more than a plural rule:
bash python -c " import re from jupyterlabserver.translationutils import getlanguagepacks, getlanguagepack ok = re.compile(r'\snplurals\s=\s\d+\s;\splural\s=[\s\-?|&=!<>+/%:;n0-9()]+') packs, = getlanguagepacks() for locale in packs: data, = getlanguagepack(locale) for domain, catalog in (data or {}).items(): header = catalog.get('', {}).get('pluralforms') if header and not ok.fullmatch(header): print('SUSPECT', locale, domain, repr(header)) "
The command prints nothing when every catalogue is sound. A line of output names the pack to remove.
Other sources
JupyterLab is an extensible environment for interactive and reproducible computing, based on the Jupyter Notebook Architecture. From JupyterLab 3.0.0 until 4.5.11 and 4.6.4, and in JupyterLite Core 0.8.3 and earlier, the Plural-Forms header in a selected third-party language pack can append JavaScript after a valid plural rule because prefix-only regular-expression validation accepts a matching prefix without requiring the entire header to match. JupyterLab passes the accepted expression to new Function, so loading the catalogue and translating a plural string executes the appended code in the authenticated JupyterLab origin. Where Jupyter Server kernels, terminals, and APIs are exposed, the code can use authenticated server APIs to read or modify files and run code. Impact is much more limited in JupyterLite because it typically lacks most exposed Jupyter Server surfaces. The default English locale is unaffected because it does not load a translation catalogue. This issue is fixed in JupyterLab 4.5.11 and 4.6.4 and JupyterLite Core 0.8.4.
— NVD
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/jupyterlite-coreto a version that resolves this vulnerability.Fixed in 0.8.4 - Upgrade
Upgrade
pip/jupyterlabto a version that resolves this vulnerability.Fixed in 4.5.11 - Upgrade
Upgrade
pip/jupyterlabto a version that resolves this vulnerability.Fixed in 4.6.4 - Upgrade
Upgrade
JupyterLabto a version that resolves this vulnerability.Fixed in 4.5.11 - Upgrade
Upgrade
JupyterLabto a version that resolves this vulnerability.Fixed in 4.6.4 - Upgrade
Upgrade
JupyterLite Coreto a version that resolves this vulnerability.Fixed in 0.8.4 - Configuration
Use the English locale, which loads no translation catalogue; configure c.LabApp.default_locale = 'en' or run jupyter lab --LabApp.default_locale=en.
JupyterLab LabApp.default_locale = en
Event History
Frequently Asked Questions
Which deployments have the greatest potential impact?
JupyterLab deployments where Jupyter Server kernels, terminals, or APIs are exposed have the greatest impact. Code executed through the issue runs in the authenticated JupyterLab origin and can use those authenticated server APIs to read or modify files and run code.
What conditions are needed for exploitation?
A crafted third-party language pack must be selected, its catalogue must be loaded, and a plural string must be translated. The malicious code is appended after an otherwise valid Plural-Forms rule.
Are default installations affected?
The default English locale is unaffected because it does not load a translation catalogue. Exposure depends on selecting a third-party language pack.
What can be done before an update is available?
Use the default English locale and avoid selecting third-party language packs, particularly untrusted ones. This prevents the affected translation catalogue path from being used.
Which releases contain the fix?
The issue is fixed in JupyterLab 4.5.11 and 4.6.4, and in JupyterLite Core 0.8.4.