Skip to content

Remote DoS on maliciously crafted answer#293

Open
xypiie wants to merge 2 commits intoNLnetLabs:developfrom
xypiie:develop
Open

Remote DoS on maliciously crafted answer#293
xypiie wants to merge 2 commits intoNLnetLabs:developfrom
xypiie:develop

Conversation

@xypiie
Copy link

@xypiie xypiie commented Jan 14, 2026

  • buffer: don't bail out when request is bigger than buffer
    to prevent remote DoS by malicious DNS repsonses, don't bail out
    with assert(), but copy as much as possible.
    This will probably lead to incomplete response, but the error
    handling of ldns will take over and the process will not just be
    killed.
    Issue found by Maciej Musial, Robert Rozanski and Monika Walendzik.

  • ldns_str2rdf_dname: check for successful mallocs
    ldns_str2rdf_dname() is calling ldns_rdf_new_frm_data() but was not
    checking the return value for valid allocated memory.
    This could cause NULL pointer derefs in following code.
    Correcting this and returning LDNS_STATUS_MEM_ERR on failed mallocs.

Peter Kaestle added 2 commits January 13, 2026 14:24
ldns_str2rdf_dname() is calling ldns_rdf_new_frm_data() but was not
checking the return value for valid allocated memory.
This could cause NULL pointer derefs in following code.

Correcting this and returning LDNS_STATUS_MEM_ERR on failed mallocs.

Signed-off-by: Peter Kaestle <peter.kaestle@nokia.com>
to prevent remote DoS by malicious DNS repsonses, don't bail out
with assert(), but copy as much as possible.
This will probably lead to incomplete response, but the error
handling of ldns will take over and the process will not just be
killed.

Issue found by Maciej Musial, Robert Rozanski and Monika Walendzik.

Signed-off-by: Peter Kaestle <peter.kaestle@nokia.com>
@wtoorop
Copy link
Member

wtoorop commented Jan 14, 2026

Thanks. 7d98a7c looks fine and I'd like to accept that one right away.
ec313f4 , I'd like to accept partly. We cannot simply change a function prototype, so I propose having a new version of ldns_buffer_write_at (perhaps ldns_buffer_write_available_at ), and I would like to keep the assert, but then within ldns_buffer_write... I'll do a suggestion.

wtoorop added a commit that referenced this pull request Jan 14, 2026
With remaining current function prototypes and behaviour, though improving ldns_buffer_write for production builds.
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.

2 participants