CVE-2021-42771
Python vulnerability analysis and mitigation

Overview

Babel.Locale in Babel before version 2.9.1 contains a directory traversal vulnerability that allows attackers to load arbitrary locale .dat files containing serialized Python objects, leading to potential code execution. The vulnerability was discovered in 2021 and is tracked as CVE-2021-42771. The issue affects Python applications using Babel versions prior to 2.9.1 (Tenable Research, NVD).

Technical details

The vulnerability exists in the Babel.Locale functionality where a directory traversal flaw can be exploited to load arbitrary locale .dat files from outside the intended locale-data directory using path traversal sequences (../../). When a property of a Locale object is accessed, the specified locale .dat file is deserialized using Python's pickle.load() method, which can lead to arbitrary code execution if an attacker can cause a maliciously crafted .dat file to be loaded. The vulnerability has a CVSS v3.1 Base Score of 7.8 (HIGH) with vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (Tenable Research, NVD).

Impact

If exploited, this vulnerability could allow attackers to execute arbitrary code within the context of the running process through deserialization of malicious locale files. This could potentially lead to complete system compromise depending on the privileges of the running process (Tenable Research).

Mitigation and workarounds

The recommended mitigation is to update Babel to version 2.9.1 or later, which includes a fix for this vulnerability. The fix was implemented through a pull request that adds proper validation of locale identifiers before loading files (Github PR, Debian Advisory).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-22871HIGH8.7
  • PythonPython
  • guarddog
NoYesJan 13, 2026
GHSA-58pv-8j8x-9vj2HIGH8.6
  • PythonPython
  • jaraco.context
NoYesJan 13, 2026
CVE-2026-22779MEDIUM6.3
  • PythonPython
  • blacksheep
NoYesJan 14, 2026
CVE-2026-21889LOW2.3
  • PythonPython
  • weblate
NoYesJan 14, 2026
CVE-2025-68492LOW2.3
  • PythonPython
  • chainlit
NoYesJan 14, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management