Skip to content

Validate platform-tools version before path construction in AVM uninstall #4805

Description

@AkashJana18

avm platform-tools uninstall currently accepts arbitrary strings as platform-tools versions and passes them directly to PathBuf::join.

Inputs containing path traversal components (e.g. v1.54/../../../victim) resolve outside $AVM_HOME/platform-tools and are later passed to fs::remove_dir_all.

Expected behavior: Only valid platform-tools version identifiers should be accepted.

Suggested fix:

  • Validate the version before path construction.
  • Reject path separators and non-normal path components.
  • Share the validation between install and uninstall.
  • Add a regression test.

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