Repository navigation
fix(key): image-mem 只接受经缩略图确认的密钥,Linux 取钥前先检查 ptrace 权限 - #856
Merged
Merged
Conversation
- 内存扫描检查解密后整块的结构(JPEG 的 APPn 标识或量化表、PNG 到 IHDR、GIF 版本、RIFF/WEBP), Linux 与 macOS 共用 weflow-native 的 image_key_scan - 不带密文时用最新几张缩略图的首块一起扫描,候选要让一张缩略图连同尾部 XOR 整张解码, 或让两张以上不同缩略图的首块解成图片头才接受,否则继续扫描 - 结果加 verification 字段;给了密文时只验证这一块,--save 拒绝保存 - Linux 读进程内存被拒(ptrace_scope)、macOS task_for_pid 被拒时报权限错误,不再报未找到 - 相邻两次读取重叠 15 字节,跨读取边界的密钥也能找到 fixed #853 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 等待微信重启之前读 ptrace_scope 和本进程的 CapEff:为 1、2 且没有 CAP_SYS_PTRACE 时立即报错, 为 3 时说明连 root 也不能附加;--pid 同样先检查 - 补上 Linux 附加失败和读不了内存的中文报错 - 退出微信的提示按平台给出,Linux 不写托盘位置 fixed #854 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
在 Linux 真实账号上验证了这个分支(
一处可以再斟酌的文字: |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
修复 #852(Linux 真实账号回归)中发现的两个取钥问题。
key image-mem 返回错误的图片密钥(#853)
JFIF、Exif等)或量化表,PNG 比到IHDR,GIF 要求版本号,WebP 要求RIFF…WEBP,wxgf保持 4 字节。Linux 和 macOS 共用weflow-native的image_key_scan。verification字段,取值为jpeg_decode_and_xor_tail、sample_first_blocks或first_block。新增响应字段不影响现有客户端,所以不升 API 版本。给了密文时只验证这一块,--save在扫描前就拒绝。process_vm_readv被拒(ptrace_scope),或 macOS 上task_for_pid被拒时,报权限错误并给出处理办法,不再报「未找到」。aes_from_samples、xor_from_samples改为memory_ciphertexts和check_memory_key。XOR 直接用密钥的字节验证,不再经过只取 ASCII 的verify_derived_aes_key。Linux 没有 ptrace 权限时要等重启微信才报错(#854)
key db在等待微信重启之前,读取ptrace_scope和本进程/proc/self/status的CapEff:值为 1 或 2 且没有CAP_SYS_PTRACE时立即报错,值为 3 时说明连 root 也不能附加。--pid同样先检查。测试
cargo clippy --workspace --all-targets -D warnings,以及image_key_scan、image_keys_e2e、ptrace_access、messages_zh、commands::key的测试。linux_key_helper的平台测试(合成进程里的image_mem,含被拒的候选),以及 core、cli 的相关测试。fixed #853
fixed #854
🤖 Generated with Claude Code