首页 网络安全 正文
  • 本文约2279字,阅读需11分钟
  • 6
  • 0

OpenMage跨站点脚本漏洞 CVE-2025-64174

摘要

栋科技漏洞库关注到OpenMage v2015.0及更早版本受存储跨站点脚本(XSS)漏洞影响,追踪为CVE-2025-64174,CVSS 4.0评分5.1。

OpenMage LTS(Magento LTS)是由社区驱动的Magento Community Edition(CE)非官方长期支持版本,全球200+代码贡献者维护。

一、基本情况

OpenMage LTS是Magento社区版(CE)的长期支持替代品,产品旨在为 Magento 1.x 用户提供稳定、安全且具备长期维护的替代方案。

OpenMage LTS弥补官方 Magento 1.x 停止支持后的空白,聚焦于安全性、稳定性和性能优化,同时保持与官方版本的高度向后兼容性。

OpenMage跨站点脚本漏洞 CVE-2025-64174

栋科技漏洞库关注到OpenMage v2015.0及更早版本受存储跨站点脚本(XSS)漏洞影响,追踪为CVE-2025-64174,CVSS 4.0评分5.1。

二、漏洞分析

CVE-2025-64174漏洞是存在于OpenMage 20.15.0及以下版本中的存在的一个受存储的跨站点脚本(XSS)漏洞,该漏洞影响范围较小。

该漏洞可能被具有直接数据库访问权限的管理员或管理员通知源滥用,以将恶意脚本注入易受攻击的字段,问题在版本20.16.0中已修复。

未转义的翻译字符串和URL被打印到app/code/core/Mage/Adminhtml/Block/Notiation/Grid/Render/Actions.php中的上下文中。

当受害者浏览到包含易受攻击字段的页面时,他们的浏览器中可能会执行恶意JavaScript,恶意翻译或受污染的数据可以注入脚本。

不过,只有具有管理或翻译权限的攻击者才能利用此漏洞。

1、链接标签使用__()而不转义。

2、'deleteConfirm()'方法嵌入消息时未进行转义处理。

具体漏洞代码如下

app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Actions.php
@@ -21,28 +21,33 @@ class Mage_Adminhtml_Block_Notification_Grid_Renderer_Actions extends Mage_Admin
     */
    public function render(Varien_Object $row)
    {
        $readDetailsHtml = ($row->getUrl())
            ? '<a target="_blank" href="' . $row->getUrl() . '">' .
                Mage::helper('adminnotification')->__('Read Details') . '</a> | '
        $escapedRowUrl =  $this->escapeUrl($row->getUrl());
        $readDetailsHtml = ($escapedRowUrl)
            ? '<a target="_blank" href="' . $escapedRowUrl . '">' .
                $this->escapeHtml(Mage::helper('adminnotification')->__('Read Details')) . '</a> | '
            : '';

        $markAsReadHtml = (!$row->getIsRead())
            ? '<a href="' . $this->getUrl('*/*/markAsRead/', ['_current' => true, 'id' => $row->getId()]) . '">' .
                Mage::helper('adminnotification')->__('Mark as Read') . '</a> | '
                $this->escapeHtml(Mage::helper('adminnotification')->__('Mark as Read')) . '</a> | '
            : '';

        $deleteConfirmHtml = sprintf("deleteConfirm('%s', this.href)",
            Mage::helper('core')->jsQuoteEscape(Mage::helper('adminnotification')->__('Are you sure?')),
        );

        /** @var Mage_Core_Helper_Url $helper */
        $helper = $this->helper('core/url');
        return sprintf(
            '%s%s<a href="%s" onClick="deleteConfirm(\'%s\', this.href); return false;">%s</a>',
            '%s%s<a href="%s" onClick="%s; return false;">%s</a>',
            $readDetailsHtml,
            $markAsReadHtml,
            $this->getUrl('*/*/remove/', [
                '_current' => true,
                'id' => $row->getId(),
                Mage_Core_Controller_Front_Action::PARAM_NAME_URL_ENCODED => $helper->getEncodedUrl()]),
            Mage::helper('adminnotification')->__('Are you sure?'),
            Mage::helper('adminnotification')->__('Remove'),
            $deleteConfirmHtml,
            $this->escapeHtml(Mage::helper('adminnotification')->__('Remove')),
        );
    }
}
app/design/adminhtml/default/default/template/widget/grid/massaction.phtml
@@ -38,13 +38,13 @@ 
<?php foreach ($this->getGroupedItems() as $key => $group): ?>
    <?php if ($key === 'default'): ?>
        <?php foreach ($group as $_item): ?>
            <option 
                value="<?php echo $_item->getId() ?>"
                <?php echo ($_item->getSelected() ? ' selected="selected"' : '') ?>
            >
                <?php echo $this->escapeHtml($_item->getLabel()) ?>
            </option>
        <?php endforeach ?>
    <?php elseif ($key === 'grouped'): ?>
        <?php foreach ($group as $label => $_massGroup): ?>
            <optgroup label="<?php echo $this->quoteEscape($label); ?>">
                <?php foreach ($_massGroup as $_item): ?>
                    <option 
                        value="<?php echo $_item->getId() ?>"
                        <?php echo ($_item->getSelected() ? ' selected="selected"' : '') ?>
                    >
                        <?php echo $this->escapeHtml($_item->getLabel()) ?>
                    </option>
                <?php endforeach ?>
            </optgroup>
        <?php endforeach ?>
    <?php endif ?>
<?php endforeach ?>

三、POC概念验证

1、将XSS添加到管理区域设置(例如app/locale/en_US/local.csv):

管理员已设置登录后刷新可查看

2、刷新缓存。确保区域设置为en_US。

3、添加任何管理员通知(例如通过test.php)

管理员已设置登录后刷新可查看

4、打开Admin → System → Notifications → Inbox.

5、Profit.

四、影响范围

OpenMage <= 20.15.0

五、修复建议

OpenMage >= 20.16.0

六、参考链接

管理员已设置登录后刷新可查看



扫描二维码,在手机上阅读
评论
更换验证码
友情链接