CVE-2015-1340 chmod race in doUidshiftIntoContainer
A race condition in LXD allows attackers to change file permissions on the host system via symbolic links, potentially leading to privilege escalation.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2015-1340?
CVE-2015-1340 is a high-severity vulnerability in Ubuntu LXD, published on 22 Apr 2019. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
LXD before version 0.19-0ubuntu5 doUidshiftIntoContainer() has an unsafe Chmod() call that races against the stat in the Filepath.Walk() function. A symbolic link created in that window could cause any file on the system to have any mode of the attacker's choice.
Weakness: CWE-362
Which versions are affected by CVE-2015-1340?
3 open source packages ship an affected version, including github.com/lxc/lxd. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
github.com/lxc/lxd Go | All versions | 0.0.0-20151004155856-19c6961cc101 |
github.com/lxc/lxd Go | All versions | 0.0.0-20151004155856-19c6961cc101 |
github.com/lxc/lxd Go | All versions | 0.0.0-20151004155856-19c6961cc101 |
Products include Linuxcontainers Lxd.
How do I fix CVE-2015-1340?
Upgrade github.com/lxc/lxd to 0.0.0-20151004155856-19c6961cc101 or later.
Is CVE-2015-1340 being exploited?
There is no known exploitation of CVE-2015-1340 in the wild and no public exploit code.
Sources
Also known as GHSA-8mpq-fmr3-6jxv, GO-2021-0071.