CVE-2021-3907 Arbitrary filepath traversal via URI injection
Attackers can write files outside the cache directory via URI injection, potentially leading to remote code execution on the host.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2021-3907?
CVE-2021-3907 is a high-severity path traversal vulnerability in Debian Debian Linux, published on 11 Nov 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
OctoRPKI does not escape a URI with a filename containing "..", this allows a repository to create a file, (ex. rsync://example.org/repo/../../etc/cron.daily/evil.roa), which would then be written to disk outside the base cache folder. This could allow for remote code execution on the host machine OctoRPKI is running on.
Which versions are affected by CVE-2021-3907?
5 open source packages ship an affected version, including github.com/cloudflare/cfrpki. It affects 2 products.
| Package | Affected | Fixed in |
|---|---|---|
github.com/cloudflare/cfrpki Go | All versions | 1.4.3 |
github.com/cloudflare/cfrpki Go | All versions | 1.4.3 |
github.com/cloudflare/cfrpki Go | All versions | 1.4.4 |
github.com/cloudflare/cfrpki Go | All versions | 1.4.4 |
github.com/cloudflare/cfrpki Go | All versions | 1.4.4 |
Products include Cloudflare Octorpki, Debian Debian Linux.
How do I fix CVE-2021-3907?
Upgrade github.com/cloudflare/cfrpki to a fixed version for your release line: 1.4.3 or 1.4.4.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2021-3907 being exploited?
There is no known exploitation of CVE-2021-3907 in the wild and no public exploit code.
Other vulnerabilities in Debian Debian Linux
- CVE-2021-3978 Improper Preservation of Permissions in github.com/cloudflare/cfrpki/cmd/octorpki
- CVE-2021-3761 OctoRPKI lacks contextual out-of-bounds check when validating RPKI ROA maxLength values
- CVE-2021-3908 Infinite certificate chain depth results in OctoRPKI running forever
- CVE-2022-3616 OctoRPKI crash when maximum iterations number is reached
- CVE-2021-3909 Infinite open connection causes OctoRPKI to hang forever
Sources
Also known as DEBIAN-CVE-2021-3907, GHSA-8459-6rc9-8vf8, GHSA-cqh2-vc2f-q4fh, GO-2022-0248, UBUNTU-CVE-2021-3907.