Skip to content
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

Update dnsmasq to v2.91test9 #2166

Merged
merged 10 commits into from
Jan 24, 2025
Merged

Update dnsmasq to v2.91test9 #2166

merged 10 commits into from
Jan 24, 2025

Conversation

DL6ER
Copy link
Member

@DL6ER DL6ER commented Jan 24, 2025

What does this implement/fix?

Change compared to last tagged version:

mplement "DNS-0x20 encoding"

This provides extra protection against reply-spoof attacks.

Since DNS queries are case-insensitive, it's possible to randomly flip the case of letters in a query and still get the correct answer back. This adds an extra dimension for a cache-poisoning attacker to guess when sending replies in-the-blind since it's expected that the legitimate answer will have the same pattern of upper and lower case as the query, so any replies which don't can be ignored as malicious.

The amount of extra entropy clearly depends on the number
of a-z and A-Z characters in the query, and this implementation puts a hard limit of 32 bits to make rescource allocation easy. This about doubles entropy over the standard random ID and random port combination.

Related issue or feature (if applicable): N/A

Pull request in docs with documentation (if applicable): N/A


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

Checklist:

  • The code change is tested and works locally.
  • I based my code and PRs against the repositories developmental branch.
  • I signed off all commits. Pi-hole enforces the DCO for all contributions
  • I signed all my commits. Pi-hole requires signatures to verify authorship
  • I have read the above and my PR is ready for review.

simonkelley and others added 7 commits January 23, 2025 05:55
When checking that an answer is the answer to the question that
we asked, compare the name in a case-sensitive manner.

Clients can set the letters in a query to a random pattern of
uppercase and lowercase to add more randomness as protection against
cache-poisoning attacks, and we don't want to nullify that.

This actually restores the status quo before
commit ed6d29a78475f9ec91141120aba53490bc1dc39a
since matching questions and answers using a checksum
can't help but be case sensitive.

This patch is a preparation for introducing DNS-0x20
in the dnsmasq query path.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This provides extra protection against reply-spoof attacks.

Since DNS queries are case-insensitive, it's possible to randomly flip
the case of letters in a query and still get the correct answer back.
This adds an extra dimension for a cache-poisoning attacker to guess
when sending replies in-the-blind since it's expected that the
legitimate answer will have the same pattern of upper and lower case
as the query, so any replies which don't can be ignored as
malicious.

The amount of extra entropy clearly depends on the number
of a-z and A-Z characters in the query, and this implementation puts a
hard limit of 32 bits to make rescource allocation easy. This about
doubles entropy over the standard random ID and random port
combination.

Signed-off-by: DL6ER <dl6er@dl6er.de>
0x20 encoding makes them look odd, otherwise.

Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
…asq (see commit 8132969, Dec, 19, 2024)

Signed-off-by: DL6ER <dl6er@dl6er.de>
@DL6ER DL6ER requested a review from a team January 24, 2025 04:14
@DL6ER DL6ER enabled auto-merge January 24, 2025 04:15
Signed-off-by: DL6ER <dl6er@dl6er.de>
Copy link
Member

@yubiuser yubiuser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have a test for MiXed cASe queries?

…A-Z is 0x41..0x5A, a-z is 0x61-0x7A). The 0x20 bit does not carry any information as DNS is case-insensitive. Hence, we can use it as additional "nounce" bits.

Signed-off-by: DL6ER <dl6er@dl6er.de>
@DL6ER DL6ER disabled auto-merge January 24, 2025 16:28
@DL6ER DL6ER marked this pull request as draft January 24, 2025 16:28
… create new building test containers already including this package

Signed-off-by: DL6ER <dl6er@dl6er.de>
@DL6ER DL6ER marked this pull request as ready for review January 24, 2025 18:23
@DL6ER DL6ER enabled auto-merge January 24, 2025 18:23
@DL6ER
Copy link
Member Author

DL6ER commented Jan 24, 2025

Again ready for review after adding tests. Initially, I planed to create a new building container tag including py3-dnspython but creating new build containers is currently failing on GHA for armv8 for all recent stable Alpine releases. It is unclear how long this issue persists.

@DL6ER DL6ER requested a review from yubiuser January 24, 2025 19:48
@DL6ER DL6ER merged commit ead34f5 into development Jan 24, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants