Skip to content

Potential Path Traversal Vulnerability in "copyDirectoryFromPod" method #4323

@chenyihao396

Description

@chenyihao396

Describe the bug
Hi,
When checking the CVE-2020-8570 fix commit, I discovered that a potential CWE-22 vulnerability still exists in the "Copy.java" file "copyDirectoryFromPod" method, which affects from version"client-java-parent-10.0.1" to the latest version.

The normalName variable, generated from srcPath (representing the extracted file name), is normalized using FilenameUtils.normalize(entry.getName()) but is not properly validated to ensure that it doesn't contain path traversal sequences like ../.

As a result, an attacker may could craft malicious file names in the tar archive (e.g., ../../etc/passwd) to potentially overwrite or access files outside of the intended destination directory, causing a security risk.

Vulnerability Type
Path Traversal (CWE-22)

Affected Versions
client-java-parent-10.0.1 through the latest version

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions