ioweb-gr/polyshell-disable-file-upload 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ioweb-gr/polyshell-disable-file-upload

Composer 安装命令:

composer require ioweb-gr/polyshell-disable-file-upload

包简介

Magento 2 module that disables file custom option uploads as a temporary PolyShell mitigation.

README 文档

README

Temporary Magento 2 hardening module that mitigates PolyShell-style abuse until the store is upgraded and fully patched.

What it provides

The module includes three practical protections:

  • A hard block for file custom option uploads.
  • A narrower image-extension-only mitigation inspired by Mark Shust's workaround.
  • A CLI command to scan and optionally clear files from pub/media/custom_options.

Admin configuration

Configuration is available at:

Stores > Configuration > Security > PolyShell Protection

Disable PolyShell Uploads

When enabled, the module hard-blocks file custom option uploads:

  • REST and API-driven file custom option payloads are rejected.
  • Standard Magento file custom option validation is rejected too.

Use this if the store does not rely on file custom options at all.

Allow Only Image Extensions

When enabled, the module applies an image-only extension allowlist to the relevant Magento image upload path:

  • rejects non-image filename extensions during image content validation
  • restricts the uploader to jpg, jpeg, gif, and png

Use this if you want a narrower mitigation and still need image-only behavior.

Default configuration

For safety, both protections default to Yes.

CLI command

The module adds this command:

bin/magento ioweb:polyshell:custom-options:scan

Behavior:

  • Dry-run by default: lists files under pub/media/custom_options that would be removed.
  • Deletes only when --force is supplied.
  • Ignores .htaccess and .gitignore.

Example:

bin/magento ioweb:polyshell:custom-options:scan --force

Installation

Add the repository to your project and require the package:

composer config repositories.ioweb-polyshell-disable-file-upload vcs https://github.com/ioweb-gr/polyshell-disable-file-upload.git
composer require ioweb-gr/polyshell-disable-file-upload
bin/magento module:enable Ioweb_PolyshellDisableFileUpload
bin/magento setup:upgrade
bin/magento cache:flush

Notes

  • This module is a temporary mitigation, not a replacement for upgrading Magento.
  • Keep web server protections on /media/custom_options/ in place even with this module installed.
  • If your store genuinely uses file custom options, test carefully before enabling the hard block mode.

统计信息

  • 总下载量: 724
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2026-03-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固