Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: Sanitization for IPA path strings #430

Merged
merged 1 commit into from Oct 19, 2022

Conversation

ohaiibuzzle
Copy link
Member

@ohaiibuzzle ohaiibuzzle commented Oct 19, 2022

This PR attempts to fix for a potential security issue in PlayCover IPA extraction where it may be vulnerable to shell command injections.

For example: two IPA files could be delivered to an user

  • valid.ipa <-- Valid ZIP archive (can be hidden, so that zip exits with code 0)
  • valid.ipa;some_command|printf .ipa <-- also a valid IPA file

When the second IPA is selected to be install, PlayCover will run

/bin/zsh -c "unzip -oq /path/to/file/valid.ipa;some_command&&printf\ .ipa -d <tempdir>

Which:

  • Extracts the first IPA to the working directory (not the allocated temp dir since we escaped that)
  • Runs whatever command is specified (some_command)

Examples:

  • valid.ipa;as|printf .ipa which should hang PlayCover indefinitely as as waits for input
  • -;bluetoothd&&.ipa which will crash your Mac

@ohaiibuzzle ohaiibuzzle changed the title fix: Sanitization for IPA path strings fix!: Sanitization for IPA path strings Oct 19, 2022
@Depal1 Depal1 merged commit 6780fa4 into PlayCover:develop Oct 19, 2022
@ohaiibuzzle ohaiibuzzle deleted the fix/sanitize-strings branch October 20, 2022 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants