fix: harden local key and database handling - #21
Open
fyw3624 wants to merge 2 commits into
Open
Conversation
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.
Summary
initread-only by default and adddoctorplus HMAC-verifiedkeys import --stdinVerification
python -m compileall -q wechat_cli testspython -m unittest discover -s tests -v— 34 passed, 2 POSIX-only permission tests skipped on Windowsruff check --select E4,E7,E9,Fon the changed security modules and testspython npm/scripts/build.py win32-x64— standalone EXE built successfullywechat-cli.exe doctor --json— identified Weixin 4.1.13.12 and a valid Tencent signature withread_process_memory: falsewechat-cli.exe init --scan-memory --confirm-memory-scan— failed closed withWXCLI_SCAN_UNSUPPORTED_CLIENTbefore requesting process-memory read accessReal behavior proof
Behavior addressed: Initialization no longer performs an implicit process-memory scan, and untrusted key documents cannot become active state without real database-page HMAC proof.
Real environment tested: Windows 11 with signed Weixin.exe 4.1.13.12 running.
Exact steps or command run after this patch: Built the one-file Windows executable, ran
doctor --json, then raninit --scan-memory --confirm-memory-scanagainst the detected local database directory.Evidence after fix: The packaged binary reported
read_process_memory: false,signature_valid: true, andWXCLI_SCAN_UNSUPPORTED_CLIENT; no generation became active.Observed result after fix: Default and dry-run initialization remain read-only, and even fully confirmed scanning is rejected because no client version has completed acceptance yet.
What was not tested: No real process-memory scan was accepted; macOS and Linux native platform acceptance remain outstanding.