CVE-2021-41088 Remote code execution via the web UI backend of Elvish
Attackers can execute arbitrary code on a user's machine if they visit a malicious site while the Elvish web UI backend is running.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2021-41088?
CVE-2021-41088 is a high-severity code injection vulnerability in elves elvish, published on 23 Sep 2021. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Official description
Elvish is a programming language and interactive shell, combined into one package. In versions prior to 0.14.0 Elvish's web UI backend (started by `elvish -web`) hosts an endpoint that allows executing the code sent from the web UI. The backend does not check the origin of requests correctly. As a result, if the user has the web UI backend open and visits a compromised or malicious website, the website can send arbitrary code to the endpoint in localhost. All Elvish releases from 0.14.0 onward no longer include the the web UI, although it is still possible for the user to build a version from source that includes the web UI. The issue can be patched for previous versions by removing the web UI (found in web, pkg/web or pkg/prog/web, depending on the exact version).
Which versions are affected by CVE-2021-41088?
3 open source packages ship an affected version, including github.com/elves/elvish. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
github.com/elves/elvish Go | All versions | 0.14.0 |
github.com/elves/elvish Go | All versions | 0.14.0 |
github.com/elves/elvish Go | All versions | 0.14.0 |
Products include Elv Elvish.
How do I fix CVE-2021-41088?
Upgrade github.com/elves/elvish to 0.14.0 or later.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2021-41088 being exploited?
There is no known exploitation of CVE-2021-41088 in the wild and no public exploit code.
Sources
Also known as DEBIAN-CVE-2021-41088, GHSA-fpv6-f8jw-rc3r, GO-2022-0937, UBUNTU-CVE-2021-41088.