Skip to content

PATH Hijacking issue in Pacu #533

Description

@SENSEiXENUS
  • In file main.py, binary clear s executed with os.system() without the path specified e.g /usr/bin/clear or /bin/clear. An attacker can control the PATH environment variable leading to code execution.
#line 687
elif command[0] == 'clear':
    if sys.platform == "win32":
        os.system("cls")
     else:
         os.system("clear")
  • Walkthrough-:
  • Prepping the path up-:
Image
  • Result-:
Image
  • Fix-:
os.system('/usr/bin/clear')

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