Bug 1955615 (CVE-2021-20095) - CVE-2021-20095 python-babel: relative path traversal allows an attacker to load arbitrary locale files on disk and execute arbitrary code
Summary: CVE-2021-20095 python-babel: relative path traversal allows an attacker to lo...
Keywords:
Status: NEW
Alias: CVE-2021-20095
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1956899 1956900 1956901 1956902 1956903 1956904 1957075 1954814 1955725
Blocks: 1955616
TreeView+ depends on / blocked
 
Reported: 2021-04-30 14:18 UTC by Guilherme de Almeida Suckevicz
Modified: 2021-05-05 02:04 UTC (History)
20 users (show)

Fixed In Version: python-babel 2.9.1
Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in python-babel. A path traversal vulnerability was found in how locale data files are checked and loaded within python-babel, allowing a local attacker to trick an application that uses python-babel to load a file outside of the intended locale directory. The highest threat from this vulnerability is to data confidentiality and integrity as well as service availability.
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description Guilherme de Almeida Suckevicz 2021-04-30 14:18:16 UTC
Relative Path Traversal in Babel 2.9.0 allows an attacker to load arbitrary locale files on disk and execute arbitrary code.

Reference:
https://www.tenable.com/security/research/tra-2021-14

Upstream patch:
https://github.com/python-babel/babel/pull/782

Comment 1 Guilherme de Almeida Suckevicz 2021-04-30 17:39:27 UTC
Created babel tracking bugs for this issue:

Affects: fedora-all [bug 1955725]

Comment 2 Riccardo Schirone 2021-05-04 15:01:18 UTC
External References:

https://www.tenable.com/security/research/tra-2021-14

Comment 4 Riccardo Schirone 2021-05-04 15:43:58 UTC
An application that uses `babel.Locale` to create a new Locale object with an untrusted language argument might be vulnerable to this flaw. The babel library uses the language argument to retrieve a file on disk, however it does not perform any check to ensure that the language is a well formed name and that it does not contain special path characters (e.g. `..`).

The locale files are essentially dumps of pickle, thus an attacker who can create a file on the system and trick an application to use that file as a babel Locale can easily execute arbitrary code on the vulnerable system.


Note You need to log in before you can comment on or make changes to this bug.