Vulnerabilities in pkg:maven/io.jooby/jooby

PACKAGE
Advisory Identifier: GHSA-px9h-x66r-8mpc
Advisory Summary

CVE-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.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/io.jooby/jooby

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/io.jooby/jooby. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-px9h-x66r-8mpc CVE-2020-7647 MODERATE path traversal in Jooby

CVE-2020-7647 at a Glance

CVE Identifier CVE-2020-7647
GHSA Identifier GHSA-px9h-x66r-8mpc
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Jooby
Package Ecosystem Maven
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (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.

io.jooby:jooby fixed: 2.8.2
<dependency>
    <groupId>io.jooby</groupId>
    <artifactId>jooby</artifactId>
    <version>2.8.2</version>
</dependency>
org.jooby:jooby fixed: 2.8.2
<dependency>
    <groupId>org.jooby</groupId>
    <artifactId>jooby</artifactId>
    <version>2.8.2</version>
</dependency>
Verify Direct and Transitive Dependencies

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

### 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: ``` java 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](https://github.com/jooby-project/jooby/blob/1.x/jooby/src/main/java/org/jooby/handlers/AssetHandler.java) ``` java 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: ```java 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: ```java 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](https://github.com/jooby-project/jooby/issues) * Email us at [support@jooby.io](mailto:support@jooby.io)

CVE-2020-7647 Affected Jooby Versions

2 component(s)
Fixed Versions:
2.8.2
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?
CVE-2020-7647 is a security vulnerability in Jooby involving path traversal in Jooby under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Jooby versions are affected?
Affected versions include releases prior to 2.8.2 across affected packages: io.jooby:jooby, org.jooby:jooby.
What version fixes CVE-2020-7647?
Upgrading to 2.8.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jooby affected?
Yes, io.jooby:jooby is affected in releases prior to 2.8.2. Upgrade your dependency to 2.8.2 or later.
What is the CVSS score of CVE-2020-7647?
CVE-2020-7647 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2020-7647?
CVE-2020-7647 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (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.).
How can I check Maven dependencies for CVE-2020-7647?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=io.jooby'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}