-
-
Notifications
You must be signed in to change notification settings - Fork 253
fix: handle DNSSEC validation for large RSA exponents and improve DNSKEY matching #1935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1935 +/- ##
==========================================
- Coverage 91.70% 90.19% -1.52%
==========================================
Files 90 90
Lines 6259 6434 +175
==========================================
+ Hits 5740 5803 +63
- Misses 387 492 +105
- Partials 132 139 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes DNSSEC validation issues related to large RSA exponents and improves DNSKEY matching by requiring both key tag and algorithm to match. Additionally, it relaxes wildcard validation requirements for positive responses, accepting wildcard expansions without NSEC/NSEC3 proof when cryptographic signatures are present.
Key changes:
- Enhanced DNSKEY matching to check both algorithm and key tag (preventing potential algorithm confusion attacks)
- Added detection and handling for RSA keys with exponents exceeding Go crypto's 2^31-1 limit
- Modified wildcard validation to accept positive responses without NSEC/NSEC3 proof (aligning with major validators like BIND and Unbound)
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| resolver/dnssec/wildcard.go | Relaxes wildcard validation to accept positive responses without NSEC/NSEC3 proof, relying on cryptographic signature validation |
| resolver/dnssec/wildcard_test.go | Updates tests to reflect new wildcard validation behavior for positive responses |
| resolver/dnssec/validator.go | Refactors RRset validation to group by name+type instead of type only, adds handling for unsupported RSA exponents, improves RRSIG matching |
| resolver/dnssec/validator_test.go | Updates tests for new grouping logic and wildcard validation behavior |
| resolver/dnssec/rrset.go | Adds RSA exponent validation, enhances DNSKEY matching with algorithm check, implements RRSIG sorting by strength, adds new findMatchingRRSIGs function |
| resolver/dnssec/rrset_test.go | Updates tests to pass algorithm parameter to findMatchingDNSKEY and queryAndMatchDNSKEY functions |
| resolver/dnssec/chain.go | Adds DNSKEY RRset verification using validated KSK, implements findAndValidateKSK helper function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [ghcr.io/0xerr0r/blocky](https://github.com/0xERR0R/blocky) | minor | `v0.27.0` -> `v0.28.2` | --- ### Release Notes <details> <summary>0xERR0R/blocky (ghcr.io/0xerr0r/blocky)</summary> ### [`v0.28.2`](https://github.com/0xERR0R/blocky/releases/tag/v0.28.2) [Compare Source](0xERR0R/blocky@v0.28.1...v0.28.2) ##### Changelog ##### Features - [`26ac90c`](0xERR0R/blocky@26ac90c): feat: add MIPS architecture builds ([#​1929](0xERR0R/blocky#1929)) ([@​0xERR0R](https://github.com/0xERR0R)) ##### Bug fixes - [`605a361`](0xERR0R/blocky@605a361): fix: handle DNSSEC validation for large RSA exponents and improve DNSKEY matching ([#​1935](0xERR0R/blocky#1935)) ([@​0xERR0R](https://github.com/0xERR0R)) ##### Misc - [`b776ae5`](0xERR0R/blocky@b776ae5): refactor: remove duplicated code patterns in resolver and cmd packages ([#​1932](0xERR0R/blocky#1932)) ([@​Copilot](https://github.com/Copilot)) ### [`v0.28.1`](https://github.com/0xERR0R/blocky/releases/tag/v0.28.1) [Compare Source](0xERR0R/blocky@v0.28.0...v0.28.1) ##### Changelog ##### Bug fixes - [`5657ce8`](0xERR0R/blocky@5657ce8): fix: resolve DNSSEC validation issue for CNAMEs in unsigned zones ([#​1930](0xERR0R/blocky#1930)) ([@​0xERR0R](https://github.com/0xERR0R)) ##### Build and dependencies - [`f4b6b75`](0xERR0R/blocky@f4b6b75): build: Update regex for bug fixes in goreleaser config ([@​0xERR0R](https://github.com/0xERR0R)) ##### Misc - [`0a3c724`](0xERR0R/blocky@0a3c724): refactor: remove unused code ([#​1928](0xERR0R/blocky#1928)) ([@​0xERR0R](https://github.com/0xERR0R)) ### [`v0.28.0`](https://github.com/0xERR0R/blocky/releases/tag/v0.28.0) [Compare Source](0xERR0R/blocky@v0.27.0...v0.28.0) ##### Changelog ##### Features - [`77578da`](0xERR0R/blocky@77578da): feat: add DNSSEC validation ([#​1914](0xERR0R/blocky#1914)) ([@​0xERR0R](https://github.com/0xERR0R)) - [`b29eab4`](0xERR0R/blocky@b29eab4): feat: add SOA records to NXDOMAIN responses for RFC 2308 compliance ([#​1895](0xERR0R/blocky#1895)) ([@​0xERR0R](https://github.com/0xERR0R)) - [`d0681ae`](0xERR0R/blocky@d0681ae): feat: enhance error messages with more context ([#​1894](0xERR0R/blocky#1894)) ([@​0xERR0R](https://github.com/0xERR0R)) - [`ac8ca7d`](0xERR0R/blocky@ac8ca7d): feat: respect NO\_COLOR environment variable ([#​1911](0xERR0R/blocky#1911)) ([@​aanderse](https://github.com/aanderse)) - [`629b4f0`](0xERR0R/blocky@629b4f0): feat: support DNS Stamp upstream format ([#​1922](0xERR0R/blocky#1922)) ([@​0xERR0R](https://github.com/0xERR0R)) ##### Bugfixes - [`8aad53e`](0xERR0R/blocky@8aad53e): fix: TCP response truncation ([#​1904](0xERR0R/blocky#1904)) ([@​TimQuelch](https://github.com/TimQuelch)) - [`9d4a58c`](0xERR0R/blocky@9d4a58c): fix: allow list group initialization with partial source failures ([#​1889](0xERR0R/blocky#1889)) ([@​0xERR0R](https://github.com/0xERR0R)) - [`0993a17`](0xERR0R/blocky@0993a17): fix: ensure HTTP response bodies are drained before closing for connection reuse ([#​1924](0xERR0R/blocky#1924)) ([@​0xERR0R](https://github.com/0xERR0R)) - [`1a98cda`](0xERR0R/blocky@1a98cda): fix: ensure conditional upstreams initialize independently of default upstreams ([#​1890](0xERR0R/blocky#1890)) ([@​0xERR0R](https://github.com/0xERR0R)) - [`0804760`](0xERR0R/blocky@0804760): fix: resolve panic when CNAME points to external domain ([#​1867](0xERR0R/blocky#1867)) ([#​1884](0xERR0R/blocky#1884)) ([@​0xERR0R](https://github.com/0xERR0R)) ##### Build and dependencies - [`0cd5be8`](0xERR0R/blocky@0cd5be8): build(deps): bump actions/download-artifact from 5 to 6 ([#​1907](0xERR0R/blocky#1907)) ([@​dependabot](https://github.com/dependabot)\[bot]) - [`5db30c4`](0xERR0R/blocky@5db30c4): build(deps): bump actions/upload-artifact from 4 to 5 ([#​1908](0xERR0R/blocky#1908)) ([@​dependabot](https://github.com/dependabot)\[bot]) - [`fc7ebe3`](0xERR0R/blocky@fc7ebe3): build(deps): bump amannn/action-semantic-pull-request from 5 to 6 ([#​1897](0xERR0R/blocky#1897)) ([@​dependabot](https://github.com/dependabot)\[bot]) - [`6a4d411`](0xERR0R/blocky@6a4d411): build(deps): bump github.com/avast/retry-go/v4 from 4.6.1 to 4.7.0 ([#​1888](0xERR0R/blocky#1888)) ([@​dependabot](https://github.com/dependabot)\[bot]) - [`9e293c0`](0xERR0R/blocky@9e293c0): build(deps): bump github.com/breml/rootcerts from 0.3.1 to 0.3.2 ([#​1886](0xERR0R/blocky#1886)) ([@​dependabot](https://github.com/dependabot)\[bot]) - [`e81bf41`](0xERR0R/blocky@e81bf41): build(deps): bump github.com/breml/rootcerts from 0.3.2 to 0.3.3 ([#​1912](0xERR0R/blocky#1912)) ([@​dependabot](https://github.com/dependabot)\[bot]) - [`073c8bf`](0xERR0R/blocky@073c8bf): build(deps): bump github.com/docker/docker from 28.5.1+incompatible to 28.5.2+incompatible ([#​1915](0xERR0R/blocky#1915)) ([@​dependabot](https://github.com/dependabot)\[bot]) - [`2dac748`](0xERR0R/blocky@2dac748): build(deps): bump github.com/onsi/ginkgo/v2 from 2.26.0 to 2.27.1 ([#​1906](0xERR0R/blocky#1906)) ([@​dependabot](https://github.com/dependabot)\[bot]) - [`8f534e6`](0xERR0R/blocky@8f534e6): build(deps): bump github.com/onsi/ginkgo/v2 from 2.27.1 to 2.27.2 ([#​1909](0xERR0R/blocky#1909)) ([@​dependabot](https://github.com/dependabot)\[bot]) - [`7fa1c78`](0xERR0R/blocky@7fa1c78): build(deps): bump github.com/testcontainers/testcontainers-go from 0.39.0 to 0.40.0 ([#​1916](0xERR0R/blocky#1916)) ([@​dependabot](https://github.com/dependabot)\[bot]) - [`5b147cc`](0xERR0R/blocky@5b147cc): build(deps): bump github.com/testcontainers/testcontainers-go/modules/mariadb from 0.39.0 to 0.40.0 ([#​1918](0xERR0R/blocky#1918)) ([@​dependabot](https://github.com/dependabot)\[bot]) - [`80aeaa9`](0xERR0R/blocky@80aeaa9): build(deps): bump github.com/testcontainers/testcontainers-go/modules/postgres from 0.39.0 to 0.40.0 ([#​1917](0xERR0R/blocky#1917)) ([@​dependabot](https://github.com/dependabot)\[bot]) - [`1cdaf72`](0xERR0R/blocky@1cdaf72): build(deps): bump github.com/testcontainers/testcontainers-go/modules/redis from 0.39.0 to 0.40.0 ([#​1919](0xERR0R/blocky#1919)) ([@​dependabot](https://github.com/dependabot)\[bot]) - [`7663b7d`](0xERR0R/blocky@7663b7d): build(deps): bump golang.org/x/net from 0.46.0 to 0.47.0 ([#​1925](0xERR0R/blocky#1925)) ([@​dependabot](https://github.com/dependabot)\[bot]) - [`8a212de`](0xERR0R/blocky@8a212de): build(deps): bump gorm.io/gorm from 1.31.0 to 1.31.1 ([#​1913](0xERR0R/blocky#1913)) ([@​dependabot](https://github.com/dependabot)\[bot]) - [`157f91f`](0xERR0R/blocky@157f91f): build(release): Add changelog groups for features and fixes ([@​0xERR0R](https://github.com/0xERR0R)) - [`d3e8b3b`](0xERR0R/blocky@d3e8b3b): build: add pr title validation workflow ([#​1893](0xERR0R/blocky#1893)) ([@​0xERR0R](https://github.com/0xERR0R)) - [`44074e4`](0xERR0R/blocky@44074e4): build: cache Go dependencies in Docker builds ([#​1899](0xERR0R/blocky#1899)) ([@​0xERR0R](https://github.com/0xERR0R)) - [`21a65de`](0xERR0R/blocky@21a65de): build: enable dependabot automerge ([#​1891](0xERR0R/blocky#1891)) ([@​0xERR0R](https://github.com/0xERR0R)) - [`8bf91c4`](0xERR0R/blocky@8bf91c4): build: remove unused tools ([#​1900](0xERR0R/blocky#1900)) ([@​0xERR0R](https://github.com/0xERR0R)) - [`4656429`](0xERR0R/blocky@4656429): build: simplify build ([#​1892](0xERR0R/blocky#1892)) ([@​0xERR0R](https://github.com/0xERR0R)) - [`ab77fd5`](0xERR0R/blocky@ab77fd5): build: update tool dependencies ([#​1898](0xERR0R/blocky#1898)) ([@​0xERR0R](https://github.com/0xERR0R)) - [`824ca3e`](0xERR0R/blocky@824ca3e): build: use Docker for mkdocs-material documentation server ([@​0xERR0R](https://github.com/0xERR0R)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi41LjAiLCJ1cGRhdGVkSW5WZXIiOiI0Mi41LjAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbImltYWdlIl19--> Reviewed-on: https://gitea.alexlebens.dev/alexlebens/infrastructure/pulls/2100 Co-authored-by: Renovate Bot <[email protected]> Co-committed-by: Renovate Bot <[email protected]>
closes #1934