Skip to content

Safe Tarfile incorrectly blocks Symlink Traversal Attempt #769

Closed
@AndrewFasano

Description

@AndrewFasano

(I'm attempting to break #763 and #761 into smaller issues with concrete bugs and examples)

Filesystem: https://files.dlink.com.au/Products/DCS-6517/REV_B/Firmware/Firmware_2.00.03/DCS-6517B1_FW_v2.00.03.zip

Binwalk extraction produces 173 symlinks that unblob drops. For example sbin/init -> ../bin/busybox. Unblob does not produce these due to incorrect symlink handling in _safe_tarfile.py

2024-02-14 18:19.09 [warning  ] Traversal attempt through link path. Skipped. path=sbin/init pid=58

Tested with head of main and #768, both produce the same behavior (since this bug is specific to the logic in safe_tarfile)

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