Directories created via os.MkdirAll are not checked for permissions
dragonflyoss dragonfly
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| github.com/dragonflyoss/dragonfly Go |
|
|
| d7y.io/dragonfly/v2 Go |
|
|
dragonflyoss dragonfly
| Product | Affected | Fixed in |
|---|---|---|
| github.com/dragonflyoss/dragonfly Go |
|
|
| d7y.io/dragonfly/v2 Go |
|
|
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.
From the CVE record · GitHub_M
Before 2.1.0, DragonFly2 does not check permissions when a directory it needs already exists. A local attacker can create that directory with broad permissions first, potentially allowing them to tamper with files DragonFly2 later uses.
Check deployments using Go packages github.com/dragonflyoss/dragonfly or d7y.io/dragonfly/v2 before 2.1.0.