Skip to content

Fix auth nsec3 code - #1280

Merged
gthess merged 4 commits into
masterfrom
bugfix/auth-nsec3-hang-on-broken-zone
May 12, 2025
Merged

gthess merged 4 commits into
masterfrom
bugfix/auth-nsec3-hang-on-broken-zone

Conversation

@gthess

@gthess gthess commented May 9, 2025

Copy link
Copy Markdown
Member

Fix NSEC3 code to not break on broken auth zones that include unsigned out of zone (above apex) data. Could lead to hang while trying to prove a wildcard answer. Reported by Dmitrii Kuvaiskii from Amazon Web Services.

gthess added 2 commits May 9, 2025 14:56
  out of zone (above apex) data. Could lead to hang while trying to
  prove a wildcard answer.
  Reported by Dmitrii Kuvaiskii from Amazon Web Services.
@gthess
gthess requested a review from wcawijngaards May 9, 2025 13:11
@gthess gthess self-assigned this May 9, 2025
gthess added 2 commits May 9, 2025 15:38
- Bailing out on zone apex;
- Explicit parenthesis.

@wcawijngaards wcawijngaards left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This fixes the issues in the places it was reported and also extra checks in other places. The code looks nice.

@gthess
gthess merged commit 4e23523 into master May 12, 2025
@gthess
gthess deleted the bugfix/auth-nsec3-hang-on-broken-zone branch May 12, 2025 12:26
gthess added a commit that referenced this pull request May 12, 2025
- Merge #1280: Fix auth nsec3 code. Fixes NSEC3 code to not break on
  broken auth zones that include unsigned out of zone (above apex)
  data. Could lead to hang while trying to prove a wildcard answer.
@dimakuv

dimakuv commented May 12, 2025

Copy link
Copy Markdown

Five minutes late to the party, but I verified this patch on my end, using a clean Amazon Linux 2023 Docker image. It works correctly:

$ history | awk '{$1=$1;print}' | cut -d' ' -f2-

# without the fix
git clone https://github.com/NLnetLabs/unbound.git
cd unbound/
git checkout bugfix/auth-nsec3-hang-on-broken-zone~4
./configure
make -j
make install
vim testdata/auth_nsec3_wild.rpl # add the malformed line to induce hang
make test
... hangs ...

# with the fix
make distclean
git checkout bugfix/auth-nsec3-hang-on-broken-zone
./configure
make -j
make install
make test
... no hang, success!

@gthess

gthess commented May 12, 2025

Copy link
Copy Markdown
Member Author

Thanks for the verification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants