Skip to content

Path directory prefix bypass in ubifs/output.py #139

Description

@dirkmueller

in

return True if path.startswith(basedir) else False
, using path.startswith(basedir) without a trailing directory separator allows directory traversal if a target directory shares a common prefix. For example, if basedir is /tmp/target, and path is ../target_hack, os.path.realpath resolves it to /tmp/target_hack, which passes the startswith check and allows writing outside the base directory.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugpythonPull requests that update python code

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions