定制 wubinworks/module-template-filter-patch 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

wubinworks/module-template-filter-patch

Composer 安装命令:

composer require wubinworks/module-template-filter-patch

包简介

Magento 2 patch for CVE-2022-24086, CVE-2022-24087. Fix the RCE vulnerability and related bugs by performing deep template variable escaping. If you cannot upgrade Magento or cannot apply the official patches, try this one.

README 文档

README

Magento 2 patch for CVE-2022-24086, CVE-2022-24087. Fix the RCE vulnerability and related bugs by performing deep template variable escaping. If you cannot upgrade Magento or cannot apply the official patches, try this one.

Wubinworks CVE-2022-24086 CVE-2022-24087 Patch

Background

CVE-2022-24086(with CVE-2022-24087) was discovered in the beginning of 2022.

Affected Magento Versions

  • 2.3 series: <=2.3.7-p2
  • 2.4 series: <=2.4.3-p1

Affected stores come with this Remote Code Execution(RCE) vulnerability without workaround. 2 official isolated patches were released on February 2022.

However, even in late 2024, we are still receiving consultations regarding this issue and their hacked stores were identified that this vulnerability was exploited. Observed attacks were performed by inputting a string that contains template directive. Typically by making use of the checkout process, actions that can trigger an email sending with user controllable fields, etc.

We make this patch due to this widespread attack and some stores still having difficulties to upgrade to unaffected versions or apply the 2 official patches.

While making this patch as an extension, we keep compatibility in mind. It is mainly tested on Magento 2.4 series.

Features

Template Compatibility

Although the official documentation says "methods can no longer be called from variables from either the var directive or when used as parameters", but as we confirmed, even in the latest version(2.4.7-p3), calling "Getter" method on Data Object and calling getUrl method on Email Template Object(\Magento\Email\Model\AbstractTemplate) are still allowed.

This patch(extension) also keeps the above features. So {{var data_object.something}} and {{var data_object.getSomething()}} are both OK and equivalent.

getUrl example:

{{var this.getUrl($store,'route_id/controller/action',[_query:[param1:$obj.param1,param2:$obj.param2],_nosid:1])}}

In summary, after installing this extension:

  • Objects which are not \Magento\Framework\DataObject or its child instance cannot be accessed
  • Only "Getter" methods are allowed on \Magento\Framework\DataObject and its child instances
  • getUrl method is only working on this

Technical Info

Official Approach

>=2.4.3-p2

Removed LegacyResolver to stop the RCE.

>=2.4.4-p2 || >=2.4.5-p1

Introduced "deferred directive with signature" for child template. We are unsure if it has any security enhancement.

Latest(2.4.7-p3)

Still has an unfixed bug(#39353).

Our Approach

Use "deep template variable escaping" before the template filtering process. LegacyResolver will only receive escaped user data and hence can be kept.

Requirements

Magento 2.3 or 2.4

Installation

composer require wubinworks/module-template-filter-patch

If you like this extension or this extension helped you, please ★star☆ this repository.

You may also like:
Magento 2 patch for CVE-2024-34102(aka Cosmic Sting)
Magento 2 Enhanced XML Security
Magento 2 Encryption Key Manager CLI
Magento 2 JWT Authentication Patch

Magento 2 Disable Customer Change Email Extension
Magento 2 Disable Customer Extension

wubinworks/module-template-filter-patch 适用场景与选型建议

wubinworks/module-template-filter-patch 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 11 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「sanitize」 「escaper」 「patch」 「magento 2」 「email template」 「cve-2022-24086」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 wubinworks/module-template-filter-patch 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 wubinworks/module-template-filter-patch 我们能提供哪些服务?
定制开发 / 二次开发

基于 wubinworks/module-template-filter-patch 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2024-11-25