Skip to content
This repository was archived by the owner on Feb 10, 2021. It is now read-only.

ReDoS Vulnerability in HDFileSystem.glob() #176

@Alphadelta14

Description

@Alphadelta14

Hi,
While auditing dependencies I found a particularly nasty ReDoS issue that is fairly simple to implement where client code is concerned.

Versions Affected: hdfs3<=0.3.1

I am publicly disclosing this so that users and package maintainers have their own choice to safeguard themselves, as this repo is not actively developed.

Scenario

Given a properly instantiated client:
hdfs = HDFileSystem()
Where there exists some file /ababababababababababababababababababababababababababababababababababababababababa (hdfs file name limit is 255)
The following expression will cause client code to seemingly hang:
hdfs.glob("/*((ab)+)+")

Potential Resolutions

  1. Switch to the native jni client / pyarrow as this repo recommends.
  2. Ensure re.escape() is called during hdfs.glob (Do not allow client code to be compiled into regular expressions)

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