Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 953870 (CVE-2025-31498, GHSA-6hxc-62jh-p29v) - <net-dns/c-ares-1.34.5: Use after free in read_answers()
Summary: <net-dns/c-ares-1.34.5: Use after free in read_answers()
Status: CONFIRMED
Alias: CVE-2025-31498, GHSA-6hxc-62jh-p29v
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Security
URL: https://github.com/c-ares/c-ares/secu...
Whiteboard: C2 [stable?]
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-15 02:43 UTC by Sam James
Modified: 2025-04-15 02:56 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-04-15 02:43:18 UTC
"""
Use after free() in read_answers() when process_answer() may re-enqueue a query either due to a DNS Cookie Failure or when the upstream server does not properly support EDNS, or possibly on TCP queries if the remote closed the connection immediately after a response. If there was an issue trying to put that new transaction on the wire, it would close the connection handle, but read_answers() was still expecting the connection handle to be available to possibly dequeue other responses.

In theory a remote attacker might be able to trigger this by flooding the target with ICMP UNREACHABLE packets if they also control the upstream nameserver and can return a result with one of those conditions, this has been untested. Otherwise only a local attacker might be able to change system behavior to make send()/write() return a failure condition.
"""
Comment 1 Larry the Git Cow gentoo-dev 2025-04-15 02:56:13 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5a56b41c04cd280afebf81c18d91a9deac344357

commit 5a56b41c04cd280afebf81c18d91a9deac344357
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2025-04-15 02:50:46 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-04-15 02:55:32 +0000

    net-dns/c-ares: add 1.34.5
    
    Bug: https://bugs.gentoo.org/953870
    Signed-off-by: Sam James <sam@gentoo.org>

 net-dns/c-ares/Manifest             |   2 +
 net-dns/c-ares/c-ares-1.34.5.ebuild | 109 ++++++++++++++++++++++++++++++++++++
 2 files changed, 111 insertions(+)