CVE-2025-59349 Directories created via os.MkdirAll are not checked for permissions

Low 2.0 Published Updated

Local attackers can tamper with files by pre-creating directories with broad permissions before the application creates them.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2025-59349?

CVE-2025-59349 is a low-severity vulnerability in dragonflyoss dragonfly, published on 17 Sep 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

Dragonfly is an open source P2P-based file distribution and image acceleration system. Prior to 2.1.0, DragonFly2 uses the os.MkdirAll function to create certain directory paths with specific access permissions. This function does not perform any permission checks when a given directory path already exists. This allows a local attacker to create a directory to be used later by DragonFly2 with broad permissions before DragonFly2 does so, potentially allowing the attacker to tamper with the files. This vulnerability is fixed in 2.1.0.

Weakness: CWE-732

Which versions are affected by CVE-2025-59349?

6 open source packages ship an affected version, including github.com/dragonflyoss/dragonfly and d7y.io/dragonfly/v2. It affects 1 product.

PackageAffectedFixed in
github.com/dragonflyoss/dragonfly GoAll versionsNone
github.com/dragonflyoss/dragonfly GoAll versions2.1.0
github.com/dragonflyoss/dragonfly GoAll versions2.1.0
d7y.io/dragonfly/v2 GoAll versions2.1.0
d7y.io/dragonfly/v2 GoAll versions2.1.0
d7y.io/dragonfly/v2 GoAll versions2.1.0

Products include Linuxfoundation Dragonfly.

How do I fix CVE-2025-59349?

Upgrade github.com/dragonflyoss/dragonfly to 2.1.0 or later.

Is CVE-2025-59349 being exploited?

There is no known exploitation of CVE-2025-59349 in the wild and no public exploit code.

Sources

Also known as GHSA-8425-8r2f-mrv6, GO-2025-3964.

Is CVE-2025-59349 in your software?

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

Check your SBOMs for free