跳转到主内容

Typecho 1.2.0 评论框存在XSS漏洞

Typecho1.2评论网址处存在XSS漏洞,如果被插入脚本,及时恢复到最近一次备份或检查其他文件是否存在shell。插入的js脚本,一个是发送cookie,另一个是往默认模板的404页面插入一句话木马。目前typecho没发布修复教程,但是github仓库已更新修复代码,预发布了1.2.1-rc版本。

防护

关闭评论
目前没有看到官方没有发布修复教程,我还是建议暂时关闭评论功能,如果不想关闭教程可以看看方法二。

修改文件

根据Typecho仓库的提交历史,可以查看到 b989459 提交内容。

修改 var/Widget/Base/Comments.php 文件第271行

echo '<a href="' . Common::safeUrl($this->url) . '"'

修改 var/Widget/Feedback.php 文件第209行和308行

//209行

$comment['url'] = $this->request->filter('trim', 'url')->url;

//308行

$trackback['url'] = $this->request->filter('trim', 'url')->url;
modified: 2023-04-04 17:21
    1. 小野的头像
      小野 [博主] IP: 中国台湾省 #1
      头像木有了
    2. lin的头像
      lin IP: 新加坡 #2
      Asking questions are really pleasant thing if you are not understanding something entirely, but this paragraph
      gives pleasant understanding yet.
      1. 小野的头像
        小野 [博主] IP: 中国广播电视网络有限公司 #3
        Really?Are you ashamed to advertise to me
    3. slot的头像
      slot IP: 新加坡 #3
      不要打广告,用名字ok?
支持 Markdown 语法