加固-03(P0-02): 删除远程在线更新链(供应链 RCE 向量)

- admin/ajax.php: checkupdate / downloadupdatepacks / unzippacks 三个
  端点合并为统一禁用存根(返回 JSON "远程更新已禁用(安全加固)");
  原逻辑从作者第三方域 (download.wenquan6.cn / download.bwenquan.com)
  下载 zip 并解压到 Web 目录、再引导浏览器访问 install.php,
  攻击者控制该域即可向所有部署实例推送恶意代码(供应链 RCE)。
- 删除辅助函数 get_zip_originalsize() 与 getFile()(仅更新链使用)。
- admin/html/welcome.html 与 admin/welcome.html: 移除"检查系统更新"
  按钮及 function update() 整段 AJAX 链,替换为静态说明文案。
- admin/ajax.php: HTTP_USER_AGENT 比较改用 ?? 回退,消除无 UAgent
  客户端触发的 Notice(UAgent 会话锁定行为保持不变)。

验证: php -l 通过;登录态调用三端点均返回禁用 JSON;
UAgent 锁定对无 UAgent 客户端正确拒绝(code:-3)。
This commit is contained in:
youpaishidifu
2026-10-10 11:21:25 +08:00
parent 6669f4bc9c
commit c60e4ebc9b
3 changed files with 20 additions and 284 deletions
+4 -98
View File
@@ -94,10 +94,8 @@
<div class="layui-collapse">
<div class="layui-colla-item">
<h2 class="layui-colla-title">系统更新</h2>
<div class="flow-default layui-colla-content layui-show" id="update">
<button class="layui-btn layui-btn-radius layui-btn-normal" style="width: 100%" onclick="update()">
立检查更新
</button>
<div class="flow-default layui-colla-content layui-show" id="update" style="padding:10px;">
<span style="color:#999;">远程在线更新已出于安全考虑禁用(供应链风险)。版本升级请通过 Git 仓库获取部署包手动更新。</span>
</div>
</div>
</div>
@@ -203,100 +201,8 @@
});
function update() {
var loading = layer.load();
$.ajax({
url: '../ajax.php?mod=checkupdate',
type: 'GET',
dataType: 'html',
data: '',
success: function (data) {
layer.close(loading);
if (data === '1') {
layer.confirm('发现更新,请问是否立即进行更新?', {
btn: ['确定', '取消'] //按钮
}, function () {
loading = layer.msg('正在下载更新包', {
icon: 16
, shade: 0.01
, time: 0
});
$.ajax({
url: '../ajax.php?mod=downloadupdatepacks',
type: 'GET',
dataType: 'json',
data: '',
success: function (data) {
layer.close(loading);
if (data.code === '1') {
loading = layer.msg('正在解压更新包', {
icon: 16
, shade: 0.01
, time: 0
});
$.ajax({
url: '../ajax.php?mod=unzippacks',
type: 'GET',
dataType: 'json',
data: '',
success: function (data) {
layer.close(loading);
if (data.code === '1') {
loading = layer.msg('正在安装更新包', {
icon: 16
, shade: 0.01
, time: 0
});
$.ajax({
url: data.updateurl,
type: 'GET',
dataType: 'html',
data: '',
success: function (data) {
layer.close(loading);
layer.alert(data);
},
error: function (data) {
layer.close(loading);
layer.msg('请求失败' + data.code);
}
})
} else {
layer.msg(data.msg);
}
},
error: function (data) {
layer.close(loading);
layer.msg('请求失败' + data.code);
}
})
} else {
layer.close(loading);
layer.msg(data.msg);
}
},
error: function (data) {
layer.close(loading);
layer.msg('请求失败' + data.code);
}
})
});
} else if (data === '-1') {
layer.alert('您当前已是最新版');
} else {
layer.alert(data);
}
},
error: function (data) {
layer.close(loading);
layer.msg('请求失败' + data);
}
})
}
/* 安全加固 (P0-02):已移除远程在线更新前端逻辑 (function update / checkupdate / downloadupdatepacks / unzippacks)。
原逻辑引导浏览器访问解压出来的 install.php,属供应链 RCE 向量。 */
</script>
</body>