CVE-2020-7647: Jooby Path Traversal Vulnerability
MODERATECVE-2020-7647 is a MODERATE (CVSS 5.3) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Jooby libraries in the Maven ecosystem. The issue involves path traversal in jooby. Remediation is available by upgrading affected packages to version 2.8.2.
CVE-2020-7647 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N).
How to Fix CVE-2020-7647
To remediate this vulnerability, upgrade all affected Jooby dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>org.jooby</groupId>
<artifactId>jooby</artifactId>
<version>2.8.2</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=io.jooby
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2020-7647, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=io.jooby
Analyze the terminal output to locate any version of Jooby in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.8.2), your application is affected.
Note: The mvn dependency:tree -Dincludes=io.jooby command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Jooby, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2020-7647 Affected Jooby Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
io.jooby:jooby
|
Maven |
< 2.8.2
|
2.8.2
|
|
org.jooby:jooby
|
Maven |
< 2.8.2
|
2.8.2
|
References
Frequently Asked Questions
What is CVE-2020-7647?
Which Jooby versions are affected?
What version fixes CVE-2020-7647?
Is jooby affected?
What is the CVSS score of CVE-2020-7647?
What CWE is associated with CVE-2020-7647?
How can I check Maven dependencies for CVE-2020-7647?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-px9h-x66r-8mpc",
"modified" : "2021-08-25T21:08:32Z",
"published" : "2020-05-13T16:29:26Z",
"aliases" : [ "CVE-2020-7647" ],
"summary" : "path traversal in Jooby",
"details" : "### Impact\nAccess to sensitive information available from classpath. \n\n### Patches\nPatched version: 1.6.7 and 2.8.2\n\nCommit 1.x: https://github.com/jooby-project/jooby/commit/34f526028e6cd0652125baa33936ffb6a8a4a009\n\nCommit 2.x: https://github.com/jooby-project/jooby/commit/c81479de67036993f406ccdec23990b44b0bec32\n\n### Workarounds\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\n### References\n\nLatest 1.x version: 1.6.6\n\n#### Arbitrary class path resource access 1\nWhen sharing a *File System* directory as in:\n\n``` java\nassets(\"/static/**\", Paths.get(\"static\"));\n```\n\nThe class path is also searched for the file (`org.jooby.handlers.AssetHandler.loader`):\n[jooby/AssetHandler.java at 1.x · jooby-project/jooby · GitHub](https://github.com/jooby-project/jooby/blob/1.x/jooby/src/main/java/org/jooby/handlers/AssetHandler.java)\n\n``` java\n private static Loader loader(final Path basedir, final ClassLoader classloader) {\n if (Files.exists(basedir)) {\n return name -> {\n Path path = basedir.resolve(name).normalize();\n if (Files.exists(path) && path.startsWith(basedir)) {\n try {\n return path.toUri().toURL();\n } catch (MalformedURLException x) {\n // shh\n }\n }\n return classloader.getResource(name);\n };\n }\n return classloader::getResource;\n }\n```\n\nIf 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\n\nIf assets are configured for a certain extension we can still bypass it. eg:\n\n```java\nassets(\"/static/**/*.js\", Paths.get(\"static\"));\n```\n\nWe can send:\n\n```\nhttp://localhost:8080/static/io/yiss/App.class.js\n```\n\n#### Arbitrary class path resource access 2\nThis vulnerability also affects assets configured to access resources from the root of the class path. eg:\n\n```java\nassets(\"/static/**\");\n```\n\nIn this case we can traverse `static` by sending:\n\n```\nhttp://localhost:8080/static/..%252fio/yiss/App.class\n```\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [jooby](https://github.com/jooby-project/jooby/issues)\n* Email us at [support@jooby.io](mailto:support@jooby.io)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "io.jooby:jooby"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.8.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.jooby:jooby"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.8.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/jooby-project/jooby/security/advisories/GHSA-px9h-x66r-8mpc"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-7647"
}, {
"type" : "WEB",
"url" : "https://github.com/jooby-project/jooby/commit/34f526028e6cd0652125baa33936ffb6a8a4a009"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/jooby-project/jooby"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JAVA-IOJOOBY-568806"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JAVA-IOJOOBY-568806,"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JAVA-ORGJOOBY-568807"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JAVA-ORGJOOBY-568807,"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2020-05-12T20:27:09Z",
"nvd_published_at" : null
}
}