CVE-2023-26145 pydash Command Injection vulnerability

High 7.4 Published Updated

Attackers can execute arbitrary code via command injection in pydash invoke methods if they control path strings and arguments.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2023-26145?

CVE-2023-26145 is a high-severity code injection vulnerability in pydash, published on 28 Sep 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

This affects versions of the package pydash before 6.0.0. A number of pydash methods such as pydash.objects.invoke() and pydash.collections.invoke_map() accept dotted paths (Deep Path Strings) to target a nested Python object, relative to the original source object. These paths can be used to target internal class attributes and dict items, to retrieve, modify or invoke nested Python objects. **Note:** The pydash.objects.invoke() method is vulnerable to Command Injection when the following prerequisites are satisfied: 1) The source object (argument 1) is not a built-in object such as list/dict (otherwise, the __init__.__globals__ path is not accessible) 2) The attacker has control over argument 2 (the path string) and argument 3 (the argument to pass to the invoked method) The pydash.collections.invoke_map() method is also vulnerable, but is harder to exploit as the attacker does not have direct control over the argument to be passed to the invoked function.

Weakness: CWE-94, CWE-77, CWE-78

Which versions are affected by CVE-2023-26145?

3 open source packages ship an affected version, including pydash. It affects 1 product.

PackageAffectedFixed in
pydash PyPIAll versions6.0.0
pydash PyPIAll versions6.0.0
pydash PyPIAll versions6.0.0

Products include Derrickgilland Pydash.

How do I fix CVE-2023-26145?

Upgrade pydash to 6.0.0 or later.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2023-26145 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-26145 exists.

Sources

Also known as GHSA-8mjr-6c96-39w8, PYSEC-2023-179.

Is CVE-2023-26145 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free