Repository navigation
Releases
v1.5.0 — signed OTA, exact-qname cache, and DNS wire fuzzing
Firmware updates are cryptographically signed, the forward cache can no longer be collision-poisoned, and DNS wire fuzzing eliminates an upstream SOA packet overrun.
The headline: Signed OTA updates & app integrity
Until now, /ota/update accepted any image that passed ESP-IDF's standard partition header checks. Anyone holding an admin session or a phished login could upload arbitrary firmware to the box answering every DNS query on the network.
Firmware images now carry an RSA-3072 signature block (CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT), verified on the device by esp_ota_end() before an OTA slot is marked bootable.
Upgrade note. The transition is seamless: v1.5.0 installs over v1.4.x via the web UI normally. From v1.5.0 onwards, the bootloader and OTA updater enforce signature checks — unsigned binaries and pre-1.5 release assets will be rejected over the air. Serial cable flashing over USB-JTAG is unaffected.
Forward cache: exact wire qname matching
The forward cache and in-flight single-flight table previously matched queries on a 32-bit Murmur3 hash with a fixed public seed. Because 32-bit collisions are trivial to precompute, a malicious or compromised LAN device could deliberately trigger lookups that collided with a target domain, poisoning the forward cache or displacing valid records for the duration of the TTL.
- Exact wire comparison: A cache hit now requires byte-for-byte comparison of the full wire-format question name (case-insensitively), evaluated on both the lwIP socket path and the Layer-2 Ethernet fast path.
- Per-boot secret seed: Upstream single-flight deduplication (reply acceptance, coalesced joins, refresh suppression) now uses a secondary hash seeded with fresh hardware entropy generated at boot.
Fuzzing and parser hardening
This release introduces automated libFuzzer harnesses (tests/fuzz/) targeting the DNS wire parser, blocklist rule grammar, and pre-auth web endpoints, uncovering and resolving edge cases:
- Upstream SOA
rdlenout-of-bounds read: In NXDOMAIN replies where an SOA record specified anrdlenextending past the packet boundary,dns_resp_min_ttlread the "minimum TTL" field up to 20 bytes beyond the received buffer. The packet bounds are now strictly enforced before decoding record fields. - 0x20 bit-scrubbing without pointer corruption (#72): Upstream resolvers using DNS 0x20 bit-case randomization could cause case mismatches. Replies are now folded back to lowercase label-by-label, carefully avoiding owner-name compression pointers so target offsets in
0x41–0x5Aare never corrupted. - Strict session cookie validation: The pre-auth HTTP header parser now enforces an exact 64-character hexadecimal length for session tokens (
sid), rejecting trailing garbage.
Dual-WAN runtime toggle & UI polish
- Runtime Wi-Fi STA toggle: Bringing up Wi-Fi alongside Ethernet (dual-WAN) no longer requires a separate firmware build or reflash. It is now a runtime toggle in the Network tab.
- Guided hotspot onboarding: If no Ethernet cable is connected at first boot, the setup Wi-Fi hotspot provides a guided network configuration wizard.
- Switchboard design system: Adopted across the device Web UI, documentation, and the browser flasher.
Verification
Verified on physical hardware including live testing on both the LilyGO T-ETH-Elite (MAC e0:72:a1:cc:1c:04) and the Waveshare ESP32-S3-ETH (MAC 28:84:85:4a:24:68). Wire fuzzing, 0x20 compression pointer checks, and signed OTA staging were validated before tagging.
Flashing
- Browser Flasher: https://glomargadaffi.github.io/ESP32_AdBlocker_Reborn/flasher/
- OTA Update: Upload
<board>-1.5.0-app.binvia Firmware Update in the web UI. - Supported Boards:
t-eth-elite(LilyGO T-ETH-Elite),waveshare-s3-eth(Waveshare ESP32-S3-ETH),generic-s3-wifi(Generic ESP32-S3 Wi-Fi only).
v1.4.0 — feed @@ exceptions, TLS-hang and cache-coherence fixes
Feed blocklists can finally say "except this one".
The headline: feed @@ exceptions are live (#117)
Blocklist maintainers write exception rules — @@||sub.example.com^ — to unblock
a subdomain their own broader rule would otherwise catch. Until now this firmware
parsed those lines, counted them, and threw them away, so only a hand-written
custom rule could produce an ALLOW. On the AdGuard DNS filter alone that was 194
inert lines.
They now work, and they work by rank rather than by specificity:
doubleclick.net BLOCKED (feed)
5471782.fls.doubleclick.net ALLOWED (feed @@ exception outranks the parent block)
The live block image and the exception table publish together behind a single
atomic snapshot, so the two can never be read from different reloads. Duplicate
exceptions merge their flags, so the outcome does not depend on feed order.
Overflowing the exception table (2048) fails closed — the warm-boot snapshot
is vetoed rather than shipping a silently truncated table, because a dropped
exception sinkholes a site the list author deliberately unblocked.
Upgrade note. Names your feeds explicitly unblock will start resolving. If a
feed's judgement is not what you want for a given name, add a custom rule
||name^$importantto override it.
Reliability
- A stalled feed download could hang a reload until reboot (#84). Fetches now
run under a watchdog, and reloads retry with backoff. A use-after-free in that
watchdog's own teardown was found and fixed along the way:esp_timerreleases
its list lock before invoking a callback, so neitheresp_timer_stop()nor
esp_timer_delete()waits for one already running. - The forward cache could serve an answer authorised under rules that had since
changed (#85). Entries were stamped with the blocklist generation at store
time — one round trip after the verdict that allowed the forward. - A blocked name could resolve for Ethernet clients after being re-blocked
(#109). Fixed by the above; the L2 path now probes the cache first, which also
removes a duplicate hash, a mutex take and a PSRAM probe from every cache hit. - A config-heavy board rendered a whole settings tab blank (#110) — silent
buffer truncation, no error, no marker. - The socket watchdog false-fired on an idle board (#128) — "nobody asked us
anything for 2 s" read identically to "the socket is wedged".
Also in this release
- A second upstream resolver from the DHCP lease is accepted as a reply source,
and the hedged retransmit can use it (#72). GET /no longer rebuilds a 5.5 KB constant page head per request (#108).- The NVS keyspace is declared in one place (#111). No key changed — renaming one
would orphan the value on deployed boards rather than move it. tools/board_client/board_client.py, a small HTTP client for the admin API.
Full detail in CHANGELOG.md.
Verification
Every change in this release was hardware-verified on a Waveshare ESP32-S3-ETH
serving live household DNS, individually and again after merge. The final smoke
run covered 28 checks across blocklist loading, verdict precedence, the forward
path, split-horizon local names, cache generation stamping, NVS persistence
across flashes, page rendering and CSRF — all passing, with wd_restarts,
feed_failures, upstream_timeouts and case_mismatch all zero.
Flashing
Browser flasher: https://glomargadaffi.github.io/ESP32_AdBlocker_Reborn/flasher/
Or POST /ota/update with the app image for your board.
Boards: t-eth-elite (LilyGO T-ETH-Elite), waveshare-s3-eth (Waveshare
ESP32-S3-ETH), generic-s3-wifi (generic ESP32-S3, Wi-Fi only).
v1.3.0 — bucket-split 40-bit blocklist
Blocklist storage moves to a bucket-split 40-bit format — same memory, wider hashes, fewer probes — and the two paths that answer a DNS query are brought back into agreement.
Flash it
Browser flasher: https://glomargadaffi.github.io/ESP32_AdBlocker_Reborn/flasher/ — it reads manifest.json from this release, detects your board from the image already on it, and flashes the matching parts. Already running 1.2.x? Use Firmware Update in the web UI and upload <board>-1.3.0-app.bin.
First boot after this upgrade re-downloads the blocklist. The SD snapshot format changed (
SD_MAGICbumped), so old and new firmware deliberately reject each other's snapshots rather than misread them.
The bug you never saw
The blocklist stored 32-bit hashes. A legitimate domain whose hash happened to collide with a table entry was sinkholed — no feed entry to explain it, and no diagnostic that would ever name the cause. At the measured 778,569-entry union that worked out to roughly 1 in 1,500 distinct legitimate domains: one or two permanently, silently broken sites for a typical household. Hashes are now 40-bit, putting it at ~1 in 350,000.
Both verdict paths now agree
A query is answered either by the L2 Ethernet fast path or by the lwIP socket loop. The fast path is supposed to produce only the verdict the socket path would, and defer everything else. Six places where that had stopped being true:
- #87 — ACL bypassed on Ethernet. A client excluded by the ACL still got blocked verdicts and cached answers; only a cold miss reached the ACL check. The fast path now requires provable permission and defers anything else.
- #102 — rewrites invisible to the fast path. A name that was both rewritten and blocklisted answered
0.0.0.0over Ethernet UDP but the configured address over TCP or Wi-Fi. Same answer on every transport now. - #88 — whitelist and custom-rule edits left stale cached verdicts. An un-block took effect at TTL expiry instead of immediately. All three mutators now bump the cache generation.
- #100 — rewrites lost to the cache. Both socket paths read the cache before the rewrite table, so a new rule stayed invisible for a whole TTL and the serve-stale refresh kept restoring the pre-rewrite answer.
- #106 — L2 parser hardened. IP version, total length, fragment flags/offset and UDP length are all validated, and DNS length now comes from the UDP header rather than the padded Ethernet frame. The hook also requires the frame to be addressed to the device's own IP — it previously answered subnet-broadcast queries, replying from the broadcast address. QCLASS is checked on all three paths; non-IN queries are forwarded instead of being cached or sinkholed as IN.
- #94 — stored XSS in the DoT server/SNI fields, which were rendered unescaped into
value="..."on the Upstream tab. Escaped, and validated on input.
Also fixed: #112 open redirect on the port-80 listener via an unvalidated Host header, #113 a truncated compression pointer followed one byte past the packet in skip_name(), and #114 a non-reentrant static parse buffer on the Ethernet RX task.
Storage format
A 65,536-slot index carries the top 16 bits of each hash as position, so only the low 24 bits are stored — 3 bytes per entry instead of 4, while the hash gets 8 bits wider. Lookups binary-search one bucket (~4 probes, mean occupancy 12.2) instead of scattering ~20 probes across the whole array. Capacity moves 820,000 → 800,000; the binding constraint is now the 5-byte staging array plus the 3-byte live image. Details in docs/blocklist-format.md.
Verified on hardware on both supported boards before release. Full detail in CHANGELOG.md and ISSUES.md.
v1.2.2 — whitelist sinkhole window, setup fail-closed, W5500 TX mutex
Three fixes from the post-1.2.1 review pass (21 findings filed as #91–#111;
the rest are tracked, not blocking).
Fixed
- Whitelisting a domain no longer sinkholes it (#99). Whitelist add/remove
held the whitelist mutex across the NVS flash write, and both verdict paths
treated a busy mutex as "not whitelisted" (= block) — so for the duration of
every whitelist edit a whitelisted-but-blocklisted name answered 0.0.0.0, and
the socket path cached that for 10 s. NVS writes now happen outside the lock;
the L2 hook treats a busy mutex as "can't decide" and hands the frame to
lwIP; the custom-rules check no longer takes the mutex when there are no
rules (the main source of contention). - Setup wizard fails closed on an unidentifiable POST (#96).
/setupand
/loginrefuse requests with neither a usableOriginnor aReferer—
the exact shape of a cross-site auto-submitting form under
referrer-policy no-referrer, which could otherwise have claimed the admin
account during the setup window. - Ethernet transmit serialized (#101).
CONFIG_ETH_TRANSMIT_MUTEX=y: the
L2 fast path and lwIP both transmit through the W5500, whose send sequence
isn't atomic. The hook now checksesp_eth_transmit()and/metricsreports
l2_tx_fail.
Install: browser flasher at https://glomargadaffi.github.io/ESP32_AdBlocker_Reborn/flasher/ (Chrome/Edge, USB), or sign in to the device, Network tab, upload <board>-1.2.2-app.bin.
v1.2.1 — local zones for DoT, static hosts, login fix
Added
- Local zones (split-horizon for DoT): names in configurable suffixes
(defaultlan, local, home, home.arpa, internal, localdomain, intranet) and
any single-label name are forwarded to the router in plain DNS even when
DoT is on. Enabling DoT used to make every router-assigned hostname
NXDOMAIN. Upstream DNS tab → Local zones;POST /dot/zones. - Static hosts table: the rewrite table accepts bare hostnames and holds
48 entries (was 16); relabelled "Local hosts & DNS rewrites".
Fixed
- Pre-session Origin check (login/setup) is case-insensitive, ignores an
explicit port, and falls back to Referer onOrigin: null; Referrer-Policy
issame-origin. A browser login could fail with a bare "CSRF".
Install: browser flasher at https://glomargadaffi.github.io/ESP32_AdBlocker_Reborn/flasher/ (Chrome/Edge, USB), or sign in to the device, Network tab, upload <board>-1.2.1-app.bin.
v1.2.0 — secure web UI (HTTPS, onboarding, sessions) + browser flasher
Security
- HTTPS-only web UI with first-boot onboarding (#89). Self-signed ECDSA
P-256 certificate generated on the device and kept in NVS;:80only
redirects. A setup wizard gates every route until an admin account exists
and shows the certificate fingerprint for pinning. Basic Auth replaced by
a login form +HttpOnly; Secure; SameSite=Strictsession cookie (30 min
idle / 12 h absolute, 4 concurrent sessions); the password is stored as a
salted PBKDF2-HMAC-SHA256 hash (a legacy plaintext one is hashed on first
boot and erased). 5 failed logins → 60 s lockout. Per-session CSRF token on
every POST in addition to the Origin/Referer check. CSP,
X-Frame-Options: DENY,nosniff,no-referreron every response (no
HSTS on purpose: with a self-signed cert it would turncert-resetinto a
year-long browser lockout). Password change requires the current password
and signs everyone out. The certificate carries EKU serverAuth, SAN =
mDNS name + 192.168.4.1, and a 2-year validity (Apple's trust rules),
regenerated at boot when expiring; a 3 s TLS handshake timeout keeps a
silent client from holding the single httpd task. A UI that fails to start
on an unverified OTA image rolls the image back instead of confirming it. - Blocklist sources must be
https://(#90), enforced at the form and at
fetch time. - Setup AP is WPA2 with a random NVS-kept passphrase printed on the USB
console, instead of open — nobody nearby can reach the setup wizard before
the owner does. - USB console gained
admin-reset,cert-reset,cert,setup-psk,
heap.
Upgrading from 1.1: the device comes up in setup mode — browse to it
right after the OTA and create the admin account, because until you do, the
first host on the LAN to open the page can. A 1.1 web password ≥ 10
characters is migrated (hashed, plaintext erased); a shorter one is dropped
and the wizard appears. The login lockout is global (one counter for the
device), so a LAN host can keep you locked out of /login with five bad
guesses a minute — acceptable for a LAN appliance, and admin-reset over
USB always works.
Added
- Browser flasher (
docs/flasher/, served from GitHub Pages): Web Serial +
esptool-js, detects the board from the firmware's version tag, fetches the
matching images from the latest release, flashes them at the right offsets.
tools/make-release.ps1stages the per-board artifacts andmanifest.json. - Board-tagged version:
esp_app_desc_t.versionis now
<version.txt>+<board>(t-eth-elite/waveshare-s3-eth). - USB console
heapcommand (internal / PSRAM free, largest, low-water).
Changed
- Web-page render buffers and the Wi-Fi scan table moved from internal .bss
to PSRAM (CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY), taking the
Waveshare from ~23 KB internal free / 7.6 KB largest to ~100 KB / 31 KB —
needed for TLS session setup to coexist with the W5500's DMA buffers. - Boot-time crypto runs on its own 12 KB task;
CONFIG_ESP_MAIN_TASK_STACK_SIZE
raised to 6144. - mDNS now advertises
_https._tcpon 443. - CMake refuses a
build-wavesharedir that isn't configured with its own
SDKCONFIG— a shared one silently rewrote the default config with the
Waveshare pin map.
Install: browser flasher at https://glomargadaffi.github.io/ESP32_AdBlocker_Reborn/flasher/ (Chrome/Edge, USB), or upload <board>-1.2.0-app.bin on the Network tab of a running 1.1 device. First visit after upgrading shows a certificate warning (self-signed) and then the setup wizard - create the admin account right away.
Note: the t-eth-elite-1.2.0-app.bin asset was removed — it had been built from a developer sdkconfig and embedded a Wi-Fi credential seed. Use the v1.2.1 assets.
v1.1.0 — speed/resilience roadmap, dual-WAN, Waveshare
Everything from the "roadmap wave 1–3" work: the speed/resilience roadmap,
dual-WAN networking, the runtime-configurable web UI, and Waveshare board
support. Verified on both the LilyGO T-ETH-Elite and the Waveshare
ESP32-S3-ETH.
Added
- Waveshare ESP32-S3-ETH board support via the
ADBLOCK_BOARDKconfig
choice and thesdkconfig.board.waveshare-s3-ethoverlay (separate
build-waveshare/build dir). - Dual-WAN: Wi-Fi STA alongside W5500 Ethernet, with the DHCP-advertised
DNS server usable as upstream (#53, #54, #55). - Runtime network configuration + tabbed web UI: per-interface DHCP/static
IP, Wi-Fi scan + connect from the browser, static-IP form prefilled from the
live lease (#52). - Upstream-parity wave: global pause, stop-load, web UI auth, browser OTA
firmware upload (no toolchain needed after the first flash). - TCP/53 listener so TC=1 retries land on the device instead of an RST;
TCP-origin forwards get a real answer and truncated upstream replies are
never cached (#66). - DNS-over-TLS worker task with a persistent TLS session; mbedTLS buffers
moved to PSRAM so TLS can actually allocate (#5). - Clock floor + real certificate date validation for TLS (#75).
- Serve-stale with background refresh — RFC 8767 optimistic cache (#68).
- SD warm-boot for the forward cache — RFC 8767 restore on reboot (#79).
- Single-flight coalescing for the upstream table (#76).
- Hedged upstream retransmit on the observed p95 latency (#69).
- Dedup-aware blocklist loading, hagezi ad-tier and threat-intel presets,
capacity telemetry, and a per-extra-list enable/disable toggle (#48 part 1). - Reload diff report: logs the exact blocklist delta vs the previous SD
snapshot (#67). - CNAME-cloaking inspection (#74, part 1 of 2).
- UDP mailbox drain-cap pressure counter in
/metricsso bursts past
LWIP_UDP_RECVMBOX_SIZEare no longer invisible (#81). - USB recovery console over native USB-Serial-JTAG.
docs/simd-acceleration-notes.md: SIMD/PIE acceleration study (verdict: no;
three bigger wins identified and since implemented).docs/http-api.md: complete HTTP route table and/metricsfield reference,
checked againstweb_ui.cpp'suris[]anddns_server_metrics_json().CONTRIBUTING.md: the architecture constraints that have actually bitten —
the two verdict paths, shared-cache coherence and the generation bump,
single-task httpd, andIRAM_ATTRplacement.
Changed
- 4-way set-associative forward cache with eviction / too-big telemetry;
qtype folded into the key so A and AAAA no longer evict each other. - IRAM_ATTR on the L2 hot path (#78).
- Extras are folded via chunk sort + backward merge instead of a whole-array
qsort. - Octal PSRAM clock 40 MHz -> 80 MHz; lwIP socket ceiling 16 -> 24.
- Software AES instead of hardware AES, removing the internal-heap DMA
allocation that killed TLS streams mid-download (#84). - Flash-size / Wi-Fi / watchdog settings moved into
sdkconfig.defaultsso
the defaults reproduce the shipped build (#82). - Wi-Fi scan runs on a worker task so it no longer blocks every web UI viewer
(#62). managed_components/is no longer tracked in git; it is regenerated by the
IDF component manager frommain/idf_component.yml+dependencies.lock.
Fixed
- Blocklist lines are parsed as hosts/adblock syntax instead of hashing the
raw text — silent blocklist corruption (#65). - Forward cache entries stamped under a stale blocklist generation are
invalidated when a reload completes (#85). - Pause toggle bumps the blocklist generation so stale ALLOW cache entries
cannot survive a resume (#86). - DNS task waits for the selected upstream interface before starting, ending
the DHCP race for the upstream resolver and advertised LAN IP (#80). - Hedge-stash EDNS regression.
- httpd recycles the LRU connection instead of refusing new ones (#61).
- The 10 s web UI refresh no longer resets tabs or wipes form input (#63).
- 15 verified review findings: honest telemetry, cross-extra dedup,
windowless publish.
No binaries attached: 1.1.0 was superseded by 1.2.0 the same day; use the 1.2.0 release.
v1.0.0 — DNS Sinkhole for LilyGO T-ETH-Elite
A native ESP-IDF DNS sinkhole for the LilyGO T-ETH-Elite (ESP32-S3 + W5500 SPI Ethernet). Hosts a ~700k-domain wildcard blocklist entirely in PSRAM, sinkholes ads/trackers at the network layer, and forwards + caches everything else — with an L2 fast path that answers blocked and cached queries without ever touching lwIP.
⚡ Performance (measured on hardware, WSL multithreaded load)
| path | latency (c=1) | throughput |
|---|---|---|
| blocked (L2 fast path) | ~1.8 ms (0.66 ms floor) | ~2,200 qps |
| allowed, cached (L2 fast path) | ~1.8 ms | ~2,100 qps |
| allowed, cold (forward) | ~40 ms (gateway RTT) | — |
Both fast paths saturate the W5500 SPI bus at ~2,200 qps with zero drops. Blocklist lookup over ~700k domains is ~64 µs. Built -O2 release (assertions off), 10% smaller than a debug build.
✨ Features
- Full OISD big list + hagezi Pro (~700k domains) in PSRAM, radix-sorted, wildcard suffix matching; multi-source with NVS-backed extra feeds
- L2 fast path — blocked & cached replies built in the Ethernet RX hook, bypassing lwIP (seqlock-guarded cross-task cache reads)
- SD instant-boot + background daily refresh; 1024-slot forward cache (A/AAAA isolated)
- Web UI + JSON
/metrics, query log with NTP wall-clock timestamps, top-N + per-minute CSS graphs - Custom block rules, whitelist, DNS rewrites, client ACL
- DNS-over-TLS upstream (opt-in, RFC 7858) with UDP fallback
- Hardened: CSRF + XSS protection, client ACL, randomized txids + question validation (anti cache-poisoning)
📥 Flash (no toolchain needed)
Single merged image — one command:
esptool.py --chip esp32s3 -p PORT -b 460800 write_flash 0x0 dns-sink-v1.0.0-lilygo-t-eth-elite.merged.binThen point your router's DNS at the board's DHCP address. (App-only dns-sink-v1.0.0-app.bin flashes at 0x10000 if you already have the matching bootloader/partition table.)
🗺️ Roadmap
- Generic ESP32-S3 build (Wi-Fi only) — coming, runs on any plain ESP32-S3 dev board with no W5500/SD required (#49)
- DoT upstream worker task; DoH/DoT server; per-list toggle + pause-blocking control (#48)
🔒 Checksums (SHA-256)
6b2ad64ce2dbc64168abf15a25631b58d056be28a70cd337f820adb5a94559a3 dns-sink-v1.0.0-app.bin
1bd893e4b0d5916a64b5d7af89e00763ba4484c99e4f15f3726be46c181be485 dns-sink-v1.0.0-lilygo-t-eth-elite.merged.bin
Built for the LilyGO T-ETH-Elite. Treat the device as trusted-LAN — don't expose port 80 to the internet.