Skip to content
Fencer Vulns
high 7.8

CVE-2021-42771 json

Directory Traversal in Babel

published 2021-10-20 5 y ago modified 2026-06-17 4 mo ago also GHSA-h4m5-qpfp-3mpv , PYSEC-2021-421 , EUVD-2021-0032

cvss
7.8
version 3.1, NVD
cisa kev
Not listed
not in CISA's catalog
epss
0.8%
EPSS 0.8% chance of exploitation in 30 days, percentile 55%
public exploits
0
none known

Summary

Babel.Locale in Babel before 2.9.1 allows attackers to load arbitrary locale .dat files (containing serialized Python objects) via directory traversal, leading to code execution.

Patch / fix

  • pypi babel 2.9.1
  • pocoo babel 2.9.1
  • python-babel Debian 14, Debian 13, Debian 12 2.8.0+dfsg.1-7

debian advisories DEBIAN-CVE-2021-42771

  • pytz RHEL 8 2019.3-3.module+el8.4.0+8888+89bc7e79
  • babel RHEL 8 2.7.0-11.module+el8.5.0+11015+9c1c7c42
  • numpy RHEL 8 1.17.3-6.module+el8.5.0+12205+a865257a
  • scipy RHEL 8 1.3.1-4.module+el8.4.0+8888+89bc7e79
  • Cython RHEL 8 0.29.14-4.module+el8.4.0+8888+89bc7e79
  • pytest RHEL 8 4.6.6-3.module+el8.4.0+8888+89bc7e79
  • PyYAML RHEL 8 5.4.1-1.module+el8.5.0+10721+14d8e0d5
  • mod_wsgi RHEL 8 4.6.8-3.module+el8.4.0+8888+89bc7e79

red hat advisories RHSA-2021:4162RHSA-2021:4151RHSA-2021:3252RHSA-2021:3254RHSA-2021:4201

  • python-Babel SLES for SAP 15 SP1, SLES for SAP 15, SLES 15-LTSS +7 more 2.5.1-150000.3.3.1
  • python-Babel OpenStack Cloud Crowbar 8, OpenStack Cloud 8, HPE Helion OpenStack 8 2.3.4-4.3.1
  • python-Babel OpenStack Cloud Crowbar 9, OpenStack Cloud 9 2.5.1-3.3.1
  • python-Babel SLE Module for Public Cloud 12 2.5.3-4.8.1
  • python-Babel SLE Module for Python 2 15 SP3, SLE Module for Python 2 15 SP2, SLE Module for Basesystem 15 SP3 +3 more 2.8.0-3.3.1

suse advisories SUSE-SU-2022:3590-1SUSE-SU-2022:0029-1SUSE-SU-2022:0028-1SUSE-SU-2021:4161-1SUSE-SU-2021:3945-1

  • python-Babel openSUSE Tumbleweed 2.18.0-1.4
  • python-Babel openSUSE Tumbleweed 2.14.0-1.5
  • python-Babel openSUSE Tumbleweed 2.9.1-3.1
  • python-Babel openSUSE Leap 15.2 2.8.0-lp152.2.3.1
  • python-Babel openSUSE Leap 15.3 2.8.0-3.3.1

opensuse advisories openSUSE-SU-2026:11986-1openSUSE-SU-2024:14127-1openSUSE-SU-2024:11602-1openSUSE-SU-2021:1553-1openSUSE-SU-2021:3945-1

  • python38-py AlmaLinux 8 1.8.0-8.module_el8.6.0+2778+cd494b30
  • python38-ply AlmaLinux 8 3.11-10.module_el8.6.0+2778+cd494b30
  • python38-six AlmaLinux 8 1.12.0-10.module_el8.6.0+2778+cd494b30
  • python38-cffi AlmaLinux 8 1.13.2-3.module_el8.6.0+2778+cd494b30
  • python38-idna AlmaLinux 8 2.8-6.module_el8.6.0+2778+cd494b30
  • python38-pytz AlmaLinux 8 2019.3-3.module_el8.6.0+2778+cd494b30
  • python38-attrs AlmaLinux 8 19.3.0-3.module_el8.6.0+2778+cd494b30
  • python38-babel AlmaLinux 8 2.7.0-11.module_el8.6.0+2778+cd494b30

almalinux advisories ALSA-2021:4162ALSA-2021:4201ALSA-2021:4151

  • pytz Rocky Linux 8 2019.3-3.module+el8.4.0+570+c2eaf144
  • babel Rocky Linux 8 2.7.0-11.module+el8.5.0+672+ab6eb015
  • numpy Rocky Linux 8 1.17.3-6.module+el8.5.0+672+ab6eb015
  • scipy Rocky Linux 8 1.3.1-4.module+el8.5.0+672+ab6eb015
  • scipy Rocky Linux 8 1.3.1-4.module+el8.4.0+570+c2eaf144
  • Cython Rocky Linux 8 0.29.14-4.module+el8.4.0+570+c2eaf144
  • pytest Rocky Linux 8 4.6.6-3.module+el8.4.0+570+c2eaf144
  • PyYAML Rocky Linux 8 5.4.1-1.module+el8.5.0+672+ab6eb015

rocky linux advisories RLSA-2021:4162RLSA-2021:4201RLSA-2021:4151

  • py3-babel Alpine 3.24, Alpine 3.23, Alpine 3.22 +6 more 2.9.1-r0

alpine advisories ALPINE-CVE-2021-42771

Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • babel CBL-Mariner 2.0 2.9.1-1

azure linux advisories AZL-6325

Azure Linux vulnerability data, Copyright (c) Microsoft Corporation, from https://github.com/microsoft/AzureLinuxVulnerabilityData via OSV, under the MIT licence; changed: normalised to fixed package versions per release. MIT

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2021-42771 updated cvss 7.8

python-babel: Relative path traversal allows attacker to load arbitrary locale files and execute arbitrary code

  • Red Hat Enterprise Linux 6 babel, python-babel Red Hat Enterprise Linux 7 babel, python-babel Red Hat OpenStack Platform 10 (Newton) babel, python-babel Red Hat OpenStack Platform 13 (Queens) babel, python2-babel
    affected: no fix planned “Out of support scope”
  • Red Hat Quay 3 quay/quay-rhel8
    affected: no fix available
  • Red Hat Storage 3 babel, python-babel
    affected: no fix planned “Will not fix”
  • Red Hat CodeReady Linux Builder (v. 8) pytest 4.6.6-3.module+el8.4.0+8888+89bc7e79, python-py 1.8.0-8.module+el8.4.0+8888+89bc7e79, python38-py 1.8.0-8.module+el8.4.0+8888+89bc7e79, python-attrs 19.3.0-3.module+el8.4.0+8888+89bc7e79, python-pluggy 0.13.0-3.module+el8.4.0+8888+89bc7e79, python-packaging 19.2-3.module+el8.4.0+8888+89bc7e79, +12 more
    fixed: vendor fix RHSA-2021:4162
  • Red Hat Enterprise Linux AppStream (v. 8) babel 2.5.1-7.el8, python3-babel 2.5.1-7.el8, pytz 2019.3-3.module+el8.4.0+8888+89bc7e79, scipy 1.3.1-4.module+el8.4.0+8888+89bc7e79, pytz 2017.2-12.module+el8.1.0+3111+de3f2d8e, PyYAML 3.12-16.module+el8.1.0+3111+de3f2d8e, +150 more
    fixed: vendor fix RHSA-2021:4151
  • Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 7) python27-babel 0.9.6-10.el7, python27-python 2.7.18-3.el7, python27-tkinter 2.7.18-3.el7, rh-python38-babel 2.7.0-12.el7, rh-python38-python 3.8.11-2.el7, python27-python-jinja2 2.6-16.el7, +18 more Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.7) python27-babel 0.9.6-10.el7, python27-python 2.7.18-3.el7, python27-tkinter 2.7.18-3.el7, rh-python38-babel 2.7.0-12.el7, rh-python38-python 3.8.11-2.el7, python27-python-jinja2 2.6-16.el7, +18 more Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 7) python27-babel 0.9.6-10.el7, python27-python 2.7.18-3.el7, python27-tkinter 2.7.18-3.el7, rh-python38-babel 2.7.0-12.el7, rh-python38-python 3.8.11-2.el7, python27-python-jinja2 2.6-16.el7, +18 more
    fixed: vendor fix RHSA-2021:3252
  • Red Hat Enterprise Linux 9 babel, python3-babel
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

Exploit prediction

0.77% chance of exploitation in the next 30 days, higher than 55% of all scored CVEs (FIRST EPSS, 2026-11-08).

Exploits and checks

  • tenable.com https://www.tenable.com/security/research/tra-2021-14 referenced PoC, tagged "exploit" by a source, unverified

CVSS scores

assigned by version score vector
NVD 3.1 7.8 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
NVD 2.0 7.2 AV:L/AC:L/Au:N/C:C/I:C/A:C
GitHub 3.1 7.8 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Affected packages

ecosystem package affected fixed in
pypi babel
<2.9.1
2.9.1

Classification

Weakness
  • CWE-22 Improper Limitation of a Pathname to a Restricted Directory

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.