hexo-theme-keep icon indicating copy to clipboard operation
hexo-theme-keep copied to clipboard

搜索功能泄露加密文章部分内容

Open Pepste2 opened this issue 11 months ago • 3 comments

Issue Checklist | Issue 检查清单

Expected behavior | 预期行为

在我认为的正常情况是,全局搜索是不包含隐藏文章内容的 我不知道这算不算是个Bug,在我已知加密文章的部分内容的情况下,尝试用全局搜索功能可以显示一小段内容,如果攻击者不断枚举关键词甚至可以推测整篇文章的内容,当然了这只是我的猜想

Actual behavior | 实际行为

  • Links to demo site with this issue (链接到这个 Issue 的演示网站)
  • https://keep.xpoet.cn/post/f41b05a7b521/
  • Links to source code of the blog with this issue (链接到这个 Issue 的博客源代码)
  • Screenshots(屏幕截图) QQ20250110-111139

Steps to reproduce the behavior | 重现步骤

直接利用全局搜索加密文章关键词即可

Node.js and NPM Information | Node.js 和 NPM 信息

>node -v
v22.11.0
>npm -v
10.9.0

Hexo Configuration | Hexo 配置

##search
search:
  path: search.json
  field: post
  content: true
  format: striptags

Keep Configuration | Keep 配置

local_search:
  enable: true   # Option values: true | false
  preload: true  # Preload the search data when the page loads. Option values: true | false

Other Information | 其它信息

浏览器:Chrome 131.0.6778.265 操作系统:Windows11 24H2 26100.2605

Pepste2 avatar Jan 10 '25 03:01 Pepste2

这确实是个严重的问题,下一版本修复

XPoet avatar Mar 07 '25 08:03 XPoet

这确实是个严重的问题,下一版本修复

这个问题恐怕难以通过keep本身修复。hexo-generator-searchdb生成json过程中就会将加密文章的全文放入查找表search.json。也许需要修改hexo-generator-searchdb的生成逻辑或是keep主题在generator生成json文件后再对其做些修改。

justaLoli avatar Mar 07 '25 11:03 justaLoli

补充下,在使用rss的时候,能在rss中直接看到加密文章内容

Cheers0606 avatar Apr 14 '25 15:04 Cheers0606