-
Notifications
You must be signed in to change notification settings - Fork 19
pmultiqc service update example for FragPipe #564
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,4 +12,5 @@ lxml | |
| numpy | ||
| pyarrow | ||
| scikit-learn | ||
| tuspyserver>=4.2.0 | ||
| tuspyserver>=4.2.0 | ||
| rarfile | ||
|
Comment on lines
+15
to
+16
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check if rarfile is documented in Dockerfile or deployment configs
fd -e Dockerfile -e dockerfile -e docker-compose -e docker-compose.yml -e "*.yaml" -e "*.yml" | head -20Repository: bigbio/pmultiqc Length of output: 41 🌐 Web query:
💡 Result: Short summary — rarfile system requirements and external dependencies:
Sources: rarfile documentation and project page; Debian package FAQ. [1][2][3] Add external RAR extraction tool to deployment configuration. The Ensure the appropriate tool is installed in your deployment configuration and document this dependency. Additionally, consider pinning a minimum version for 🤖 Prompt for AI Agents |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add security validation for RAR extraction similar to ZIP validation.
The RAR extraction lacks the security checks that
validate_and_extract_zip(lines 1691-1740) implements for user uploads:While PRIDE datasets are presumably trusted, defense-in-depth is recommended. Consider also adding error handling for
rarfile.BadRarFileexceptions.🔒 Suggested security-hardened implementation
elif filename.lower().endswith(".rar"): logger.info(f"Extracting RAR file: {filename}") - with rarfile.RarFile(file_path, "r") as rar_ref: - # Extract to the same directory - rar_ref.extractall(download_dir) - # Remove the rar file - os.remove(file_path) - # Return the directory path since rar files contain multiple files - final_file_path = download_dir - logger.info(f"Extracted {filename} to directory") + try: + with rarfile.RarFile(file_path, "r") as rar_ref: + # Security: Check for path traversal in RAR entry names + for entry in rar_ref.infolist(): + if ".." in entry.filename or entry.filename.startswith("/"): + raise Exception(f"RAR file contains invalid path: {entry.filename}") + # Extract to the same directory + rar_ref.extractall(download_dir) + # Remove the rar file + os.remove(file_path) + # Return the directory path since rar files contain multiple files + final_file_path = download_dir + logger.info(f"Extracted {filename} to directory") + except rarfile.BadRarFile as e: + logger.error(f"Invalid RAR file {filename}: {e}") + raise Exception(f"Invalid RAR file: {filename}")📝 Committable suggestion
🤖 Prompt for AI Agents