cve.bz

CVE-2021-42771 Path traversal

7.8 highExploit referenceEPSS 0.8%Fix available

High (7.8). EPSS 0.8% estimated probability of exploitation activity in the next 30 days. Fixed in babel 2.9.1.

On this page
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.

Severity

CVSS 3.1

7.8 high
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS
0.8% (unchanged from 0.8% a week ago; 0.8% 30 days ago) estimated probability of exploitation activity in the next 30 days; 57th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-22 Improper Limitation of a Pathname to a Restricted Directory (Path traversal)
OWASP Top 10
A01:2025 Broken Access Control
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-42771 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-42771?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-42771?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-42771 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
pocoo:babelbefore 2.9.1
debian:debian_linux10.0

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-h4m5-qpfp-3mpvPyPIbabel<2.9.12.9.1
PYSEC-2021-421PyPIbabel<2.9.12.9.1

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian9python-babel2.3.4+dfsg.1-2+deb9u1DLA-2790-1
Debian10python-babel2.6.0+dfsg.1-1+deb10u1DSA-5018-1
Debian12, 13, 14python-babel2.8.0+dfsg.1-7DEBIAN-CVE-2021-42771
Red Hatenterprise_linux:8::appstreamCython, python2-Cython, Cython-debugsource and 1 more0:0.28.1-7.module+el8.1.0+3111+de3f2d8eRHSA-2021:4151
Red Hatenterprise_linux:8::appstreamCython, python38-Cython, Cython-debugsource and 1 more0:0.29.14-4.module+el8.4.0+8888+89bc7e79RHSA-2021:4162
Red Hatenterprise_linux:8::appstreamPyYAML, python2-pyyaml, PyYAML-debugsource and 1 more0:3.12-16.module+el8.1.0+3111+de3f2d8eRHSA-2021:4151
Red Hatenterprise_linux:8::appstreamPyYAML, python38-pyyaml, PyYAML-debugsource and 1 more0:5.4.1-1.module+el8.5.0+10721+14d8e0d5RHSA-2021:4162
Red Hatenterprise_linux:8::appstreambabel, python2-babel0:2.5.1-10.module+el8.5.0+11014+88fc0d0bRHSA-2021:4151
Red Hatenterprise_linux:8::appstreambabel, python3-babel0:2.5.1-7.el8RHSA-2021:4201
Red Hatenterprise_linux:8::appstreambabel, python38-babel0:2.7.0-11.module+el8.5.0+11015+9c1c7c42RHSA-2021:4162
Red Hatenterprise_linux:8::appstreammod_wsgi, python38-mod_wsgi0:4.6.8-3.module+el8.4.0+8888+89bc7e79RHSA-2021:4162
Red Hatenterprise_linux:8::appstreamnumpy, python2-numpy, numpy-debugsource and 3 more1:1.14.2-16.module+el8.4.0+9406+221a4565RHSA-2021:4151
Red Hatenterprise_linux:8::appstreamnumpy, python38-numpy, numpy-debugsource and 3 more0:1.17.3-6.module+el8.5.0+12205+a865257aRHSA-2021:4162
Red Hatenterprise_linux:8::appstreampytest, python2-pytest0:3.4.2-13.module+el8.1.0+3111+de3f2d8eRHSA-2021:4151
Red Hatenterprise_linux:8::appstreampython-PyMySQL, python2-PyMySQL0:0.8.0-10.module+el8.1.0+3111+de3f2d8eRHSA-2021:4151
79 more for Red Hat in the JSON and on Red Hat's page.
SUSEEnterprise Storage 6, Linux Enterprise High Performance Computing 15 SP1-ESPOS, Linux Enterprise High Performance Computing 15 SP1-LTSS and 7 morepython-Babel2.5.1-150000.3.3.1SUSE-SU-2022:3590-1
SUSEHPE Helion OpenStack 8, OpenStack Cloud 8, OpenStack Cloud Crowbar 8python-Babel2.3.4-4.3.1SUSE-SU-2022:0029-1
SUSELinux Enterprise Micro 5.0, Linux Enterprise Micro 5.1, Linux Enterprise Module for Basesystem 15 SP2 and 3 morepython-Babel2.8.0-3.3.1SUSE-SU-2021:3945-1
SUSELinux Enterprise Module for Public Cloud 12python-Babel2.5.3-4.8.1SUSE-SU-2021:4161-1
SUSEOpenStack Cloud 9, OpenStack Cloud Crowbar 9python-Babel2.5.1-3.3.1SUSE-SU-2022:0028-1
openSUSELeap 15.2python-Babel, python-Babel-doc2.8.0-lp152.2.3.1openSUSE-SU-2021:1553-1
openSUSELeap 15.3python-Babel, python-Babel-doc2.8.0-3.3.1openSUSE-SU-2021:3945-1
openSUSETumbleweedpython-Babel2.14.0-1.5openSUSE-SU-2024:14127-1
openSUSETumbleweedpython-Babel2.18.0-1.4openSUSE-SU-2026:11986-1
openSUSETumbleweedpython-Babel2.9.1-3.1openSUSE-SU-2024:11602-1
AlmaLinux8babel, python2-babel2.5.1-10.module_el8.6.0+2781+fed64c13ALSA-2021:4151
AlmaLinux8python-nose-docs1.3.7-31.module_el8.5.0+2569+5c5719bcALSA-2021:4151
AlmaLinux8python-sqlalchemy-doc1.3.2-2.module_el8.5.0+2569+5c5719bcALSA-2021:4151
AlmaLinux8python2-Cython0.28.1-7.module_el8.6.0+2781+fed64c13ALSA-2021:4151
AlmaLinux8python2-PyMySQL0.8.0-10.module_el8.6.0+2781+fed64c13ALSA-2021:4151
AlmaLinux8python2-attrs17.4.0-10.module_el8.6.0+2781+fed64c13ALSA-2021:4151
AlmaLinux8python2-backports1.0-16.module_el8.6.0+2781+fed64c13ALSA-2021:4151
AlmaLinux8python2-backports-ssl_match_hostname3.5.0.1-12.module_el8.6.0+2781+fed64c13ALSA-2021:4151
AlmaLinux8python2-bson, python2-pymongo, python2-pymongo-gridfs3.7.0-1.module_el8.6.0+2781+fed64c13ALSA-2021:4151
AlmaLinux8python2-chardet3.0.4-10.module_el8.6.0+2781+fed64c13ALSA-2021:4151
AlmaLinux8python2-coverage4.5.1-4.module_el8.6.0+2781+fed64c13ALSA-2021:4151
AlmaLinux8python2-dns1.15.0-10.module_el8.6.0+2781+fed64c13ALSA-2021:4151
64 more for AlmaLinux in the JSON.
Rocky Linux8Cython0:0.28.1-7.module+el8.4.0+403+9ae17a31RLSA-2021:4151
Rocky Linux8Cython0:0.28.1-7.module+el8.5.0+706+735ec4b3RLSA-2021:4151
Rocky Linux8Cython0:0.29.14-4.module+el8.4.0+570+c2eaf144RLSA-2021:4162
Rocky Linux8PyYAML0:3.12-16.module+el8.4.0+403+9ae17a31RLSA-2021:4151
Rocky Linux8PyYAML0:3.12-16.module+el8.5.0+706+735ec4b3RLSA-2021:4151
Rocky Linux8PyYAML0:5.4.1-1.module+el8.4.0+574+843c4898RLSA-2021:4162
Rocky Linux8PyYAML0:5.4.1-1.module+el8.5.0+672+ab6eb015RLSA-2021:4162
Rocky Linux8babel0:2.5.1-10.module+el8.5.0+706+735ec4b3RLSA-2021:4151
Rocky Linux8babel0:2.5.1-7.el8RLSA-2021:4201
Rocky Linux8babel0:2.7.0-11.module+el8.5.0+672+ab6eb015RLSA-2021:4162
Rocky Linux8mod_wsgi0:4.6.8-3.module+el8.4.0+570+c2eaf144RLSA-2021:4162
Rocky Linux8numpy0:1.17.3-6.module+el8.5.0+672+ab6eb015RLSA-2021:4162
96 more for Rocky Linux in the JSON.
Alpinev3.16, v3.17, v3.18 and 6 morepy3-babel2.9.1-r0ALPINE-CVE-2021-42771
Azure Linux2babel2.9.1-1AZL-6325

From the distributions' data via OSV.dev: the Debian Security Tracker; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause; the Alpine secdb, CC BY-SA 4.0; Microsoft's Azure Linux vulnerability data, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Red Hat · SUSE · openSUSE · Alpine.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

It is rather uncommon for applications to use Babel.Locale() with an untrusted attacker-controlled language argument. A static language abbreviation string (e.g. "en") is most commonly used instead. For this reason, this flaw has been rated as having a security impact of Moderate.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 8python27:2.7-8050020210811095446.3e7ace8bFixed 2021-11-09RHSA-2021:4151
Red Hat Enterprise Linux 8python38:3.8-8050020210811101222.e3d35ccaFixed 2021-11-09RHSA-2021:4162
Red Hat Enterprise Linux 8python38-devel:3.8-8050020210811101222.e3d35ccaFixed 2021-11-09RHSA-2021:4162
Red Hat Enterprise Linux 8babel-0:2.5.1-7.el8Fixed 2021-11-09RHSA-2021:4201
Red Hat Software Collections for Red Hat Enterprise Linux 7python27-babel-0:0.9.6-10.el7Fixed 2021-08-24RHSA-2021:3252
Red Hat Software Collections for Red Hat Enterprise Linux 7python27-python-0:2.7.18-3.el7Fixed 2021-08-24RHSA-2021:3252
Red Hat Software Collections for Red Hat Enterprise Linux 7python27-python-jinja2-0:2.6-16.el7Fixed 2021-08-24RHSA-2021:3252
Red Hat Software Collections for Red Hat Enterprise Linux 7python27-python-pygments-0:1.5-5.el7Fixed 2021-08-24RHSA-2021:3252
Red Hat Software Collections for Red Hat Enterprise Linux 7rh-python38-babel-0:2.7.0-12.el7Fixed 2021-08-24RHSA-2021:3254
Red Hat Software Collections for Red Hat Enterprise Linux 7rh-python38-python-0:3.8.11-2.el7Fixed 2021-08-24RHSA-2021:3254
Red Hat Software Collections for Red Hat Enterprise Linux 7rh-python38-python-cryptography-0:2.8-5.el7Fixed 2021-08-24RHSA-2021:3254
Red Hat Software Collections for Red Hat Enterprise Linux 7rh-python38-python-jinja2-0:2.10.3-6.el7Fixed 2021-08-24RHSA-2021:3254
Red Hat Software Collections for Red Hat Enterprise Linux 7rh-python38-python-lxml-0:4.4.1-7.el7Fixed 2021-08-24RHSA-2021:3254
Red Hat Enterprise Linux 6babelOut of support scope
Red Hat Enterprise Linux 7babelOut of support scope
Red Hat Enterprise Linux 9babelNot affected
Red Hat OpenStack Platform 10 (Newton)babelOut of support scope
Red Hat OpenStack Platform 13 (Queens)babelOut of support scope
Red Hat Quay 3quay/quay-rhel8Affected
Red Hat Storage 3babelWill not fix
13 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2021-42771.

Attack patterns (CAPEC)

  • CAPEC-64 Using Slashes and URL Encoding Combined to Bypass Validation Logic Likelihood: High · Severity: High
  • CAPEC-76 Manipulating Web Input to File System Calls Likelihood: High · Severity: Very High
  • CAPEC-78 Using Escaped Slashes in Alternate Encoding Likelihood: High · Severity: High
  • CAPEC-79 Using Slashes in Alternate Encoding Likelihood: High · Severity: High
  • CAPEC-126 Path Traversal Likelihood: High · Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON