Vulnerabilities in pkg:maven/io.github.skylot/jadx-core

PACKAGE
Advisory Summary

GHSA-hvp5-5x4f-33fq is a LOW (CVSS 3.3) jadx file override vulnerability vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Jadx core libraries in the Maven ecosystem. The issue involves jadx file override vulnerability. Remediation is available by upgrading affected packages to version 1.5.0.

3 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/io.github.skylot/jadx-core

3 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/io.github.skylot/jadx-core. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-hvp5-5x4f-33fq - LOW JADX file override vulnerability
GHSA-fjh6-p566-wr6q - MODERATE skylot jadx affected by Incorrect Behavior Order in vulnerable dependency
GHSA-r8j4-96mx-rjcc CVE-2022-0219 MODERATE Improper Restriction of XML External Entity Reference in skylot/jadx

GHSA-hvp5-5x4f-33fq at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-hvp5-5x4f-33fq
Severity LOW
CVSS v3.1 Base Score 3.3
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Jadx core
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 3.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix GHSA-hvp5-5x4f-33fq

To remediate this vulnerability, upgrade all affected Jadx core 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.github.skylot:jadx-core fixed: 1.5.0
<dependency>
    <groupId>io.github.skylot</groupId>
    <artifactId>jadx-core</artifactId>
    <version>1.5.0</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.github.skylot

How to Check if You Are Affected

To determine whether your Java application is affected by GHSA-hvp5-5x4f-33fq, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=io.github.skylot

Analyze the terminal output to locate any version of Jadx core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.5.0), your application is affected.

Note: The mvn dependency:tree -Dincludes=io.github.skylot 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 Jadx core, 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

### Summary when jadx parses a resource file, there is an escape problem with the style file, which can overwrite other files in the directory when saving the decompile result. Although I don't think this vulnerability realizes path traversal in the true sense of the word , I reported it anyway ### Details I see that getResAlias does something with the filename. ```java private String getResAlias(int resRef, String origKeyName, @Nullable FieldNode constField) { ``` but type style will return the original filename directly. ![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232212491.jpeg) so our goal is to take a malicious file that was originally of type raw, modify its type to style, trick jadx into #### step1 create an android project using androidstudio and create a raw folder with the name attack_file_sayhiiiiiiiiiiiii, it doesn't matter what the content is! ![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232212073.jpg) generate an initial APK #### step2 extract this initial APK using ZIP software to get resources.arsc ![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232212841.jpg) drop resources.arsc into 010editor #### step3 search for the previous filename attack_file_sayhiiiiiiiiiiiii , two will appear here, we choose the second one ![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232213527.jpg) let's change the name of the file here. I'll change it to ../../_file_sayhiiiiiiiiiiiii note that you can only overwrite files in the folder where the decompile was saved. ![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232213343.jpg) #### step4 change the type of this file to style ![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232213183.jpg) modified to 0E ![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232213484.jpg) #### step5 After saving, re-compress the whole folder into a zip, then change the extension to APK. open it with JADX and you can see that it has been changed to a style type. ![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232213864.jpg) click save all ![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232213119.jpg) you can see the file escaping. ![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232213746.jpg) so we can also construct a ![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232213497.jpg) so the classes.dex file is also replaced here ![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232213075.jpg) ### PoC the details above have been written ### Impact latest version

GHSA-hvp5-5x4f-33fq Affected Jadx core Versions

1 component(s)
Fixed Versions:
1.5.0
Product / Package Ecosystem Affected Versions Fixed Version
io.github.skylot:jadx-core
Maven
< 1.5.0
1.5.0

References

Frequently Asked Questions

What is GHSA-hvp5-5x4f-33fq?
GHSA-hvp5-5x4f-33fq is a security vulnerability in Jadx core involving JADX file override vulnerability under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Jadx core versions are affected?
Affected versions include releases prior to 1.5.0 across affected packages: io.github.skylot:jadx-core.
What version fixes GHSA-hvp5-5x4f-33fq?
Upgrading to 1.5.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jadx-core affected?
Yes, io.github.skylot:jadx-core is affected in releases prior to 1.5.0. Upgrade your dependency to 1.5.0 or later.
What is the CVSS score of GHSA-hvp5-5x4f-33fq?
GHSA-hvp5-5x4f-33fq has a CVSS v3.1 base score of 3.3 (LOW) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with GHSA-hvp5-5x4f-33fq?
GHSA-hvp5-5x4f-33fq 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 GHSA-hvp5-5x4f-33fq?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=io.github.skylot'. 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-hvp5-5x4f-33fq",
  "modified" : "2024-04-22T15:56:04Z",
  "published" : "2024-04-22T15:56:04Z",
  "aliases" : [ ],
  "summary" : "JADX file override vulnerability",
  "details" : "### Summary\nwhen jadx parses a resource file, there is an escape problem with the style file, which can overwrite other files in the directory when saving the decompile result.\n\nAlthough I don't think this vulnerability realizes path traversal in the true sense of the word , I reported it anyway\n\n### Details\n\nI see that getResAlias does something with the filename.\n\n```java\nprivate String getResAlias(int resRef, String origKeyName, @Nullable FieldNode constField) {\n```\n\nbut type style will return the original filename directly.\n\n![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232212491.jpeg)\nso our goal is to take a malicious file that was originally of type raw, modify its type to style, trick jadx into\n\n#### step1\n\ncreate an android project using androidstudio and create a raw folder with the name attack_file_sayhiiiiiiiiiiiii, it doesn't matter what the content is!\n\n![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232212073.jpg)\ngenerate an initial APK\n\n#### step2 \n\nextract this initial APK using ZIP software to get resources.arsc\n\n![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232212841.jpg)\ndrop resources.arsc into 010editor\n\n#### step3\n\nsearch for the previous filename attack_file_sayhiiiiiiiiiiiii , two will appear here, we choose the second one\n\n![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232213527.jpg)\nlet's change the name of the file here. I'll change it to ../../_file_sayhiiiiiiiiiiiii\n\nnote that you can only overwrite files in the folder where the decompile was saved.\n\n![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232213343.jpg)\n#### step4 \nchange the type of this file to style\n\n![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232213183.jpg)\nmodified to 0E\n\n![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232213484.jpg)\n#### step5 \n\nAfter saving, re-compress the whole folder into a zip, then change the extension to APK.\n\nopen it with JADX and you can see that it has been changed to a style type.\n\n![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232213864.jpg)\nclick save all\n\n![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232213119.jpg)\nyou can see the file escaping.\n\n![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232213746.jpg)\nso we can also construct a  \n\n![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232213497.jpg)\nso the classes.dex file is also replaced here\n\n![img](https://quan9i.oss-cn-beijing.aliyuncs.com/img/202401232213075.jpg)\n\n### PoC\nthe details above have been written\n\n### Impact\nlatest version \n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.github.skylot:jadx-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.5.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/skylot/jadx/security/advisories/GHSA-hvp5-5x4f-33fq"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/skylot/jadx/commit/d86449a8ea26381d0ce6fafaed7deb7542dfd70b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/skylot/jadx"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-22T15:56:04Z",
    "nvd_published_at" : null
  }
}