PYSEC-2026-4059

Vulnerability from pysec - Published: 2026-10-01 16:44 - Updated: 2026-10-01 17:10
VLAI
Details

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:

jupyter lab --LabApp.default_locale=en

or the following traitlet:

c.LabApp.default_locale = '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:

python -c "
import re
from jupyterlab_server.translation_utils import get_language_packs, get_language_pack
ok = re.compile(r'\s*nplurals\s*=\s*\d+\s*;\s*plural\s*=[\s\-?|&=!<>+*/%:;n0-9_()]+')
packs, _ = get_language_packs()
for locale in packs:
    data, _ = get_language_pack(locale)
    for domain, catalog in (data or {}).items():
        header = catalog.get('', {}).get('plural_forms')
        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.

Impacted products
Name purl
jupyterlite-core pkg:pypi/jupyterlite-core

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "jupyterlite-core",
        "purl": "pkg:pypi/jupyterlite-core"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.8.4"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ],
      "versions": [
        "0.0.0a0",
        "0.1.0",
        "0.1.0a0",
        "0.1.0a1",
        "0.1.0b19",
        "0.1.0b20",
        "0.1.0b21",
        "0.1.0b22",
        "0.1.0rc0",
        "0.1.1",
        "0.1.2",
        "0.1.3",
        "0.2.0",
        "0.2.0a0",
        "0.2.0a1",
        "0.2.0a2",
        "0.2.0a3",
        "0.2.0a4",
        "0.2.0b0",
        "0.2.0b1",
        "0.2.0rc0",
        "0.2.0rc1",
        "0.2.1",
        "0.2.2",
        "0.2.3",
        "0.3.0",
        "0.3.0a0",
        "0.3.0a1",
        "0.3.0b0",
        "0.3.0rc0",
        "0.3.0rc1",
        "0.4.0",
        "0.4.0a0",
        "0.4.0a1",
        "0.4.0a2",
        "0.4.0a3",
        "0.4.0b0",
        "0.4.0b1",
        "0.4.0rc0",
        "0.4.1",
        "0.4.2",
        "0.4.3",
        "0.4.4",
        "0.4.5",
        "0.5.0",
        "0.5.0a0",
        "0.5.0a1",
        "0.5.0a2",
        "0.5.0b0",
        "0.5.0rc0",
        "0.5.1",
        "0.6.0",
        "0.6.0a0",
        "0.6.0a1",
        "0.6.0a10",
        "0.6.0a2",
        "0.6.0a3",
        "0.6.0a4",
        "0.6.0a5",
        "0.6.0a6",
        "0.6.0a7",
        "0.6.0a8",
        "0.6.0a9",
        "0.6.0b0",
        "0.6.0b1",
        "0.6.0rc0",
        "0.6.1",
        "0.6.2",
        "0.6.3",
        "0.6.4",
        "0.7.0",
        "0.7.0a0",
        "0.7.0a1",
        "0.7.0a2",
        "0.7.0a3",
        "0.7.0a4",
        "0.7.0a5",
        "0.7.0a6",
        "0.7.0a7",
        "0.7.0b0",
        "0.7.0b1",
        "0.7.0rc0",
        "0.7.0rc1",
        "0.7.0rc2",
        "0.7.1",
        "0.7.2",
        "0.7.3",
        "0.7.4",
        "0.7.5",
        "0.7.6",
        "0.8.0",
        "0.8.0a0",
        "0.8.0a1",
        "0.8.0a2",
        "0.8.0b0",
        "0.8.0b1",
        "0.8.0rc0",
        "0.8.1",
        "0.8.2",
        "0.8.3"
      ]
    }
  ],
  "aliases": [
    "CVE-2026-102830",
    "GHSA-3jqq-pw4j-pqcj"
  ],
  "details": "## Description\n\nA 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.\n\nA 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:\n\n```\nnplurals=2; plural=(n \u003e 1); \u003canything here ran as JavaScript\u003e\n```\n\nUsers are affected if all of the following are true:\n\n- they run JupyterLab 3.0.0 through 4.6.3, or an application that bundles it such as Notebook 7;\n- a language pack they did not write is installed in the environment; and\n- that language is selected, so its catalogue is loaded\n\nAn installation using the default English locale loads no catalogue and is not affected.\n\n\u003e CVE assignment pending, GitHub CNA is experiencing severe backlog\n\n### Impact\n\nThe 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.\n\nWhat 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](https://jupyterlab.readthedocs.io/en/latest/developer/internationalization.html) 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.\n\nNote: the impact is much more limited on JupyterLite which typically does not have access to most of the surfaces that this flaw exposes.\n\n### Patches\n\nJupyterLab [`v4.6.4`](https://github.com/jupyterlab/jupyterlab/releases/tag/v4.6.4) and [`v4.5.11`](https://github.com/jupyterlab/jupyterlab/releases/tag/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.\n\nJupyterLab 3.x reached end of life and receives no patch. Its users should move to a supported 4.x release.\n\nUsers of applications that depend on JupyterLab, such as Notebook v7+, should update `jupyterlab` package too.\n\n### Workarounds\n\nUse the English locale, which loads no catalogue:\n\n```bash\njupyter lab --LabApp.default_locale=en\n```\n\nor the following traitlet:\n\n```python\nc.LabApp.default_locale = \u0027en\u0027\n```\n\nEveryone then sees the interface in English, whatever language they had selected.\n\nTo check what is installed instead of switching, report any pack whose header carries more than a plural rule:\n\n```bash\npython -c \"\nimport re\nfrom jupyterlab_server.translation_utils import get_language_packs, get_language_pack\nok = re.compile(r\u0027\\s*nplurals\\s*=\\s*\\d+\\s*;\\s*plural\\s*=[\\s\\-?|\u0026=!\u003c\u003e+*/%:;n0-9_()]+\u0027)\npacks, _ = get_language_packs()\nfor locale in packs:\n    data, _ = get_language_pack(locale)\n    for domain, catalog in (data or {}).items():\n        header = catalog.get(\u0027\u0027, {}).get(\u0027plural_forms\u0027)\n        if header and not ok.fullmatch(header):\n            print(\u0027SUSPECT\u0027, locale, domain, repr(header))\n\"\n```\n\nThe command prints nothing when every catalogue is sound. A line of output names the pack to remove.",
  "id": "PYSEC-2026-4059",
  "modified": "2026-10-01T17:10:25.828296Z",
  "published": "2026-10-01T16:44:34.781942Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/jupyterlab/jupyterlab/security/advisories/GHSA-3jqq-pw4j-pqcj"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-102830"
    },
    {
      "type": "WEB",
      "url": "https://github.com/jupyterlab/jupyterlab/commit/985a3223cd77fd4f991cd90066342a90711d70f6"
    },
    {
      "type": "WEB",
      "url": "https://github.com/jupyterlab/jupyterlab/commit/de324ae91346c713c4f5e5485f97b6e914e0f774"
    },
    {
      "type": "WEB",
      "url": "https://github.com/jupyterlab/jupyterlab/commit/f9de43dc565a1118120d466117f877a189a4ce90"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/jupyterlab/jupyterlab"
    },
    {
      "type": "WEB",
      "url": "https://github.com/jupyterlab/jupyterlab/releases/tag/v4.5.11"
    },
    {
      "type": "WEB",
      "url": "https://github.com/jupyterlab/jupyterlab/releases/tag/v4.6.4"
    },
    {
      "type": "PACKAGE",
      "url": "https://pypi.org/project/jupyterlite-core"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/advisories/GHSA-3jqq-pw4j-pqcj"
    }
  ],
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "JupyterLab: Cross-site scripting (XSS) in JupyterLab via crafted language package (jupyterlab.json)"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…