CVE-2021-29425Possible limited path traversal vulnerabily in Apache Commons IO
In Apache Commons IO before 2.7, When invoking the method FileNameUtils.normalize with an improper input string, like "//../foo", or "\\..\foo", the result would be the same value, thus possibly providing access to files in the parent directory, but not further above (thus "limited" path traversal), if the calling code would use the result to construct a path value.
What to do
Likely to be exploited: EPSS gives a 11% chance of exploitation in the next 30 days. Treat it as urgent if you run an affected version.
Fixed builds are available from Debian, Maven, Ubuntu: see the table below for the fixed version per release.
Maven, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.04 | commons-io | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | commons-io | Not affected vulnerable_code_not_present | ||
| Ubuntu 20.04 | commons-io | Fixed | 2.6-2ubuntu0.20.04.1 | UBUNTU-CVE-2021-29425 |
| Ubuntu 18.04 | commons-io | Fixed | 2.6-2ubuntu0.18.04.1 | UBUNTU-CVE-2021-29425 |
| Ubuntu 16.04 | commons-io | Fix pending | UBUNTU-CVE-2021-29425 | |
| Ubuntu 14.04 | commons-io | Fix pending | 2.4-2ubuntu0.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2021-29425 |
| Debian 14 | commons-io | Fixed | 2.8.0-1 | DEBIAN-CVE-2021-29425 |
| Debian 13 | commons-io | Fixed | 2.8.0-1 | DEBIAN-CVE-2021-29425 |
| Debian 12 | commons-io | Fixed | 2.8.0-1 | DEBIAN-CVE-2021-29425 |
| Red Hat Enterprise Linux 9 | apache-commons-io | Not affected | ||
| Red Hat Enterprise Linux 9 | apache-commons-io-javadoc | Not affected | ||
| Red Hat Enterprise Linux 8 | apache-commons-io | Not affected | ||
| Red Hat Enterprise Linux 8 | apache-commons-io-javadoc | Not affected | ||
| Red Hat Enterprise Linux 7 | apache-commons-io | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | apache-commons-io-javadoc | Will not fix Out of support scope | ||
| Maven library | com.cosium.vet:vet | Fix pending | GHSA-gwrp-pvrq-jmwv | |
| Maven library | com.virjar:ratel-api | Fix pending | GHSA-gwrp-pvrq-jmwv | |
| Maven library | commons-io:commons-io | Fixed | 2.7 | GHSA-gwrp-pvrq-jmwv |
| Maven library | net.hasor:cobble-lang | Fix pending | GHSA-gwrp-pvrq-jmwv | |
| Maven library | org.apache.servicemix.bundles:org.apache.servicemix.bundles.commons-io | Fix pending | GHSA-gwrp-pvrq-jmwv | |
| Maven library | org.checkerframework.annotatedlib:commons-io | Fixed | 2.7 | GHSA-gwrp-pvrq-jmwv |
| Maven library | org.smartboot.servlet:servlet-core | Fix pending | GHSA-gwrp-pvrq-jmwv |
What the vendor says
As published in the CVE record by apache, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- Apache Software Foundation Apache Commons IO: affected: Apache Commons IO 2.2, Apache Commons IO 2.3, Apache Commons IO 2.4, Apache Commons IO 2.5, Apache Commons IO 2.6
Workaround: Neither the method in question (FileNameUtils.normalize) nor any methods, that invoke it, do actually access any files. There's only a string returned, from which a path can be constructed. In other words, a possible workaround would be not passing any unsafe input to FileNameUtils.normalize.
References
- https://issues.apache.org/jira/browse/IO-556
- https://lists.apache.org/thread.html/rc359823b5500e9a9a2572678ddb8e01d3505a7ffcadfa8d13b8780ab%40%3Cuser.commons.apache.org%3E
- https://lists.apache.org/thread.html/rfd01af05babc95b8949e6d8ea78d9834699e1b06981040dde419a330%40%3Cdev.commons.apache.org%3E
- https://lists.apache.org/thread.html/r8efcbabde973ea72f5e0933adc48ef1425db5cde850bf641b3993f31%40%3Cdev.commons.apache.org%3E
- https://lists.apache.org/thread.html/r873d5ddafc0a68fd999725e559776dc4971d1ab39c0f5cc81bd9bc04%40%3Ccommits.pulsar.apache.org%3E
- https://lists.apache.org/thread.html/r0d73e2071d1f1afe1a15da14c5b6feb2cf17e3871168d5a3c8451436%40%3Ccommits.pulsar.apache.org%3E
- https://lists.apache.org/thread.html/r47ab6f68cbba8e730f42c4ea752f3a44eb95fb09064070f2476bb401%40%3Cdev.creadur.apache.org%3E
- https://lists.apache.org/thread.html/raa053846cae9d497606027816ae87b4e002b2e0eb66cb0dee710e1f5%40%3Cdev.creadur.apache.org%3E
- https://lists.apache.org/thread.html/r8569a41d565ca880a4dee0e645dad1cd17ab4a92e68055ad9ebb7375%40%3Cdev.creadur.apache.org%3E
- https://lists.apache.org/thread.html/rfa2f08b7c0caf80ca9f4a18bd875918fdd4e894e2ea47942a4589b9c%40%3Cdev.creadur.apache.org%3E
- https://lists.apache.org/thread.html/r1c2f4683c35696cf6f863e3c107e37ec41305b1930dd40c17260de71%40%3Ccommits.pulsar.apache.org%3E
- https://lists.apache.org/thread.html/r27b1eedda37468256c4bb768fde1e8b79b37ec975cbbfd0d65a7ac34%40%3Cdev.myfaces.apache.org%3E
- https://lists.apache.org/thread.html/ra8ef65aedc086d2d3d21492b4c08ae0eb8a3a42cc52e29ba1bc009d8%40%3Cdev.creadur.apache.org%3E
- https://lists.apache.org/thread.html/r523a6ffad58f71c4f3761e3cee72df878e48cdc89ebdce933be1475c%40%3Cdev.creadur.apache.org%3E
- https://lists.apache.org/thread.html/rbebd3e19651baa7a4a5503a9901c95989df9d40602c8e35cb05d3eb5%40%3Cdev.creadur.apache.org%3E
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.