CVE-2020-7647
path traversal in Jooby
Description
Impact
Access to sensitive information available from classpath.
Patches
Patched version: 1.6.7 and 2.8.2
Commit 1.x: https://github.com/jooby-project/jooby/commit/34f526028e6cd0652125baa33936ffb6a8a4a009
Commit 2.x: https://github.com/jooby-project/jooby/commit/c81479de67036993f406ccdec23990b44b0bec32
Workarounds
Is there a way for users to fix or remediate the vulnerability without upgrading?
References
Latest 1.x version: 1.6.6
Arbitrary class path resource access 1
When sharing a File System directory as in:
assets("/static/**", Paths.get("static"));
The class path is also searched for the file (org.jooby.handlers.AssetHandler.loader):
jooby/AssetHandler.java at 1.x · jooby-project/jooby · GitHub
private static Loader loader(final Path basedir, final ClassLoader classloader) {
if (Files.exists(basedir)) {
return name -> {
Path path = basedir.resolve(name).normalize();
if (Files.exists(path) && path.startsWith(basedir)) {
try {
return path.toUri().toURL();
} catch (MalformedURLException x) {
// shh
}
}
return classloader.getResource(name);
};
}
return classloader::getResource;
}
If we send /static/WEB-INF/web.xml it will fail to load it from the file system but will go into classloader.getResource(name) where name equals /WEB-INF/web.xml so will succeed and return the requested file. This way we can get any configuration file or even the application class files
If assets are configured for a certain extension we can still bypass it. eg:
assets("/static/**/*.js", Paths.get("static"));
We can send:
http://localhost:8080/static/io/yiss/App.class.js
Arbitrary class path resource access 2
This vulnerability also affects assets configured to access resources from the root of the class path. eg:
assets("/static/**");
In this case we can traverse static by sending:
http://localhost:8080/static/..%252fio/yiss/App.class
For more information
If you have any questions or comments about this advisory:
- Open an issue in jooby
- Email us at support@jooby.io
Affected Maven artifacts (2)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| io.jooby » jooby | < 2.8.2 | 2.8.2 |
| org.jooby » jooby | < 2.8.2 | 2.8.2 |
Blast radius
73% of the dependent artifacts (112) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 2,961 |
| 2 hops | 1,022 |
| 3 hops | 516 |
| 4 hops | 58 |
Most used dependents
- org.kill-bill.billing.plugin.java » killbill-base-plugin25 usages
- org.jooby » jooby-netty22 usages
- org.jooby » jooby-jackson14 usages
- io.jooby » jooby-test14 usages
- org.jooby » jooby-jdbc11 usages
- org.jooby » jooby-assets11 usages
- org.jooby » jooby-assets-j2v811 usages
- io.jooby » jooby-netty10 usages
- io.jooby » jooby-jackson7 usages
- org.jooby » jooby-rxjava4 usages
- org.jooby » jooby-spec4 usages
- io.jooby » jooby-openapi4 usages
- org.jooby » jooby-executor3 usages
- io.jooby » jooby-utow3 usages
- io.jooby » jooby-guice3 usages
Computed from the dependency graph of build 20261125.2201 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
References
| Advisory | NVD CVE-2020-7647 | nvd.nist.gov |
| Package | jooby-project/jooby | github.com |
| Web | jooby-project/jooby advisory GHSA-px9h-x66r-8mpc | github.com |
| Web | jooby-project/jooby commit 34f5260 | github.com |
| Web | vuln/SNYK-JAVA-IOJOOBY-568806 | snyk.io |
| Web | vuln/SNYK-JAVA-IOJOOBY-568806, | snyk.io |
| Web | vuln/SNYK-JAVA-ORGJOOBY-568807 | snyk.io |
| Web | vuln/SNYK-JAVA-ORGJOOBY-568807, | snyk.io |
