Repository navigation
fix: keep pre-auth DNS plaintext when saved DoH config hijacks dnsmasq - #2
Merged
Merged
Conversation
The post_auth restore path reused dns_doh_restore, which imports and starts the saved https-dns-proxy configuration. If that configuration itself had force_dns=1 and dnsmasq_config_update='*' (for example Cloudflare/Google), restore put dnsmasq back on 127.0.0.1#5053/5054. The portal probe then got HTTP 000 and autoverify reported E_PORTAL_NOT_FOUND. - split save-original, pre-auth pause, and full restore - never start the saved proxy before auth; keep the snapshot for a later full restore - use pause instead of full restore when DoH apply or query verification fails - force dnsmasq back to the WAN-provided plaintext upstream during pause - refresh the online runtime state without writing flash on every poll - count only `autoverify daemon` in status PID/count - add regressions for a pre-existing DoH hijack and repeated auth cycles - bump package release to r19
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.
Problem
post_auth认证前的“恢复明文 DNS”复用了dns_doh_restore。它会把接管前保存的https-dns-proxy配置连同代理一起恢复/启动。如果这份原始配置本身就是force_dns=1+dnsmasq_config_update='*'(例如 Cloudflare/Google),dnsmasq 会再次指向127.0.0.1#5053/5054,门户探测拿到 HTTP 000,最终报E_PORTAL_NOT_FOUND / portal。Fix
dns_doh_save_original、dns_doh_pause和完整dns_doh_restoredns_doh_pause回退,不再 full restoreav_state_online刷新/var/run状态(不写闪存)status只统计真正的autoverify daemon,修正 PID/数量Verification
python3 test/test_dns.py:22/22 通过sh test/run.sh:WSL ext4 + 清除http_proxy/https_proxy后全部通过dash -n、git diff --check通过doh.pub:5053,gstatic=204,status online,daemon 数量 1APK:
autoverify-1.0.0-r19.apk(48,977 字节,SHA256ad76bebe505fcc438065a537c7a583cdbf87c0d8f21aef0d715725f43e7d1ec8)