{"answers":{"affected":"","exploited":"There is no known exploitation of CVE-2025-31498 in the wild and no public exploit code.","fix":"Upgrade to a fixed version.","what":"CVE-2025-31498 is a high-severity use after free vulnerability in c-ares, published on 8 Apr 2025. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2025-31498 and fix it if it is affected.\n\nWhat it is: CVE-2025-31498 is a high-severity use after free vulnerability in c-ares, published on 8 Apr 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2025-31498 in the wild and no public exploit code.\n\nAffected product: c-ares. No package-level version data is available, so check the vendor advisory linked from the reference page.\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2025-31498/ (Markdown: https://insights.sbomify.com/CVE-2025-31498/index.md)","id":"CVE-2025-31498","markdown":"https://insights.sbomify.com/CVE-2025-31498/index.md","name":"CVE-2025-31498","record":{"aliases":["ALPINE-CVE-2025-31498","ALSA-2025:4461","ALSA-2025:7426","ALSA-2025:7502","AZL-59742","BELL-CVE-2025-31498","CLEANSTART-2025-JX38595","DEBIAN-CVE-2025-31498","ECHO-6bde-78e8-d894","GHSA-6hxc-62jh-p29v","MINI-xvq2-8p4m-7v2c","RHSA-2025:4461","RHSA-2025:7426","RHSA-2025:7502","RHSA-2025:7537","RLSA-2025:4461","RLSA-2025:7426","ROOT-OS-ALPINE-320-CVE-2025-31498","USN-7477-1","openSUSE-SU-2025:14977-1"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution","denial_of_service"],"network_reachable":"yes","non_default_config":false,"product_category":"c-ares resolver library","requires_auth":"none","summary":"A use-after-free in c-ares allows remote or local attackers to cause denial of service or potentially execute code via crafted DNS responses.","user_interaction":"not_required","vuln_class":"use_after_free"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[],"cvss":{"score":8.3,"severity":"high","source":"cna","vector":"CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N","version":"4.0"},"cwes":[{"id":"CWE-416","name":"Use After Free"}],"description":"c-ares is an asynchronous resolver library. From 1.32.3 through 1.34.4, there is a 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. This vulnerability is fixed in 1.34.5.","ecosystems":["AlmaLinux:10","AlmaLinux:8","AlmaLinux:9","Red Hat:enterprise_linux:10.0","Red Hat:enterprise_linux:8::appstream","Red Hat:enterprise_linux:9::appstream","Red Hat:rhel_eus:9.4::appstream","Rocky Linux:8","Rocky Linux:9","openSUSE:Tumbleweed"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"c-ares has a use-after-free in read_answers()","id":"CVE-2025-31498","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":null,"product":null,"products":[],"type":"use_after_free","year":"2025"},"n_packages":86,"n_references":3,"next":{"headline":"Jellyfin Vulnerable to Argument Injection in FFmpeg","id":"CVE-2025-31499"},"packages":[{"ecosystem":"AlmaLinux:10","fixed":["1:22.15.0-1.el10_0"],"introduced":["0"],"last_affected":[],"package":"nodejs","purl":"pkg:rpm/almalinux/nodejs","source":"ALSA-2025:7502"},{"ecosystem":"AlmaLinux:10","fixed":["1:22.15.0-1.el10_0"],"introduced":["0"],"last_affected":[],"package":"nodejs-devel","purl":"pkg:rpm/almalinux/nodejs-devel","source":"ALSA-2025:7502"},{"ecosystem":"AlmaLinux:10","fixed":["1:22.15.0-1.el10_0"],"introduced":["0"],"last_affected":[],"package":"nodejs-docs","purl":"pkg:rpm/almalinux/nodejs-docs","source":"ALSA-2025:7502"},{"ecosystem":"AlmaLinux:10","fixed":["1:22.15.0-1.el10_0"],"introduced":["0"],"last_affected":[],"package":"nodejs-full-i18n","purl":"pkg:rpm/almalinux/nodejs-full-i18n","source":"ALSA-2025:7502"},{"ecosystem":"AlmaLinux:10","fixed":["1:22.15.0-1.el10_0"],"introduced":["0"],"last_affected":[],"package":"nodejs-libs","purl":"pkg:rpm/almalinux/nodejs-libs","source":"ALSA-2025:7502"},{"ecosystem":"AlmaLinux:10","fixed":["1:10.9.2-1.22.15.0.1.el10_0"],"introduced":["0"],"last_affected":[],"package":"nodejs-npm","purl":"pkg:rpm/almalinux/nodejs-npm","source":"ALSA-2025:7502"},{"ecosystem":"AlmaLinux:8","fixed":["1:20.19.1-1.module_el8.10.0+3987+dbda4426"],"introduced":["0"],"last_affected":[],"package":"nodejs","purl":"pkg:rpm/almalinux/nodejs","source":"ALSA-2025:4461"},{"ecosystem":"AlmaLinux:8","fixed":["1:20.19.1-1.module_el8.10.0+3987+dbda4426"],"introduced":["0"],"last_affected":[],"package":"nodejs-devel","purl":"pkg:rpm/almalinux/nodejs-devel","source":"ALSA-2025:4461"},{"ecosystem":"AlmaLinux:8","fixed":["1:20.19.1-1.module_el8.10.0+3987+dbda4426"],"introduced":["0"],"last_affected":[],"package":"nodejs-docs","purl":"pkg:rpm/almalinux/nodejs-docs","source":"ALSA-2025:4461"},{"ecosystem":"AlmaLinux:8","fixed":["1:20.19.1-1.module_el8.10.0+3987+dbda4426"],"introduced":["0"],"last_affected":[],"package":"nodejs-full-i18n","purl":"pkg:rpm/almalinux/nodejs-full-i18n","source":"ALSA-2025:4461"},{"ecosystem":"AlmaLinux:8","fixed":["3.0.1-1.module_el8.10.0+3982+85c136aa"],"introduced":["0"],"last_affected":[],"package":"nodejs-nodemon","purl":"pkg:rpm/almalinux/nodejs-nodemon","source":"ALSA-2025:4461"},{"ecosystem":"AlmaLinux:8","fixed":["2021.06-4.module_el8.10.0+3987+dbda4426"],"introduced":["0"],"last_affected":[],"package":"nodejs-packaging","purl":"pkg:rpm/almalinux/nodejs-packaging","source":"ALSA-2025:4461"},{"ecosystem":"AlmaLinux:8","fixed":["2021.06-4.module_el8.10.0+3958+472a6467"],"introduced":["0"],"last_affected":[],"package":"nodejs-packaging-bundler","purl":"pkg:rpm/almalinux/nodejs-packaging-bundler","source":"ALSA-2025:4461"},{"ecosystem":"AlmaLinux:8","fixed":["1:10.8.2-1.20.19.1.1.module_el8.10.0+3987+dbda4426"],"introduced":["0"],"last_affected":[],"package":"npm","purl":"pkg:rpm/almalinux/npm","source":"ALSA-2025:4461"},{"ecosystem":"AlmaLinux:9","fixed":["1:20.19.1-1.module_el9.6.0+163+d268fe53"],"introduced":["0"],"last_affected":[],"package":"nodejs","purl":"pkg:rpm/almalinux/nodejs","source":"ALSA-2025:7426"},{"ecosystem":"AlmaLinux:9","fixed":["1:20.19.1-1.module_el9.6.0+163+d268fe53"],"introduced":["0"],"last_affected":[],"package":"nodejs-devel","purl":"pkg:rpm/almalinux/nodejs-devel","source":"ALSA-2025:7426"},{"ecosystem":"AlmaLinux:9","fixed":["1:20.19.1-1.module_el9.6.0+163+d268fe53"],"introduced":["0"],"last_affected":[],"package":"nodejs-docs","purl":"pkg:rpm/almalinux/nodejs-docs","source":"ALSA-2025:7426"},{"ecosystem":"AlmaLinux:9","fixed":["1:20.19.1-1.module_el9.6.0+163+d268fe53"],"introduced":["0"],"last_affected":[],"package":"nodejs-full-i18n","purl":"pkg:rpm/almalinux/nodejs-full-i18n","source":"ALSA-2025:7426"},{"ecosystem":"AlmaLinux:9","fixed":["3.0.1-1.module_el9.5.0+125+8dc38870"],"introduced":["0"],"last_affected":[],"package":"nodejs-nodemon","purl":"pkg:rpm/almalinux/nodejs-nodemon","source":"ALSA-2025:7426"},{"ecosystem":"AlmaLinux:9","fixed":["2021.06-4.module_el9.6.0+162+8dc602e5"],"introduced":["0"],"last_affected":[],"package":"nodejs-packaging","purl":"pkg:rpm/almalinux/nodejs-packaging","source":"ALSA-2025:7426"},{"ecosystem":"AlmaLinux:9","fixed":["2021.06-4.module_el9.6.0+162+8dc602e5"],"introduced":["0"],"last_affected":[],"package":"nodejs-packaging-bundler","purl":"pkg:rpm/almalinux/nodejs-packaging-bundler","source":"ALSA-2025:7426"},{"ecosystem":"AlmaLinux:9","fixed":["1:10.8.2-1.20.19.1.1.module_el9.6.0+163+d268fe53"],"introduced":["0"],"last_affected":[],"package":"npm","purl":"pkg:rpm/almalinux/npm","source":"ALSA-2025:7426"},{"ecosystem":"Red Hat:enterprise_linux:10.0","fixed":["1:22.15.0-1.el10_0"],"introduced":["0"],"last_affected":[],"package":"nodejs","purl":"pkg:rpm/redhat/nodejs","source":"RHSA-2025:7502"},{"ecosystem":"Red Hat:enterprise_linux:10.0","fixed":["1:22.15.0-1.el10_0"],"introduced":["0"],"last_affected":[],"package":"nodejs-debuginfo","purl":"pkg:rpm/redhat/nodejs-debuginfo","source":"RHSA-2025:7502"},{"ecosystem":"Red Hat:enterprise_linux:10.0","fixed":["1:22.15.0-1.el10_0"],"introduced":["0"],"last_affected":[],"package":"nodejs-devel","purl":"pkg:rpm/redhat/nodejs-devel","source":"RHSA-2025:7502"},{"ecosystem":"Red Hat:enterprise_linux:10.0","fixed":["1:22.15.0-1.el10_0"],"introduced":["0"],"last_affected":[],"package":"nodejs-docs","purl":"pkg:rpm/redhat/nodejs-docs","source":"RHSA-2025:7502"},{"ecosystem":"Red Hat:enterprise_linux:10.0","fixed":["1:22.15.0-1.el10_0"],"introduced":["0"],"last_affected":[],"package":"nodejs-full-i18n","purl":"pkg:rpm/redhat/nodejs-full-i18n","source":"RHSA-2025:7502"},{"ecosystem":"Red Hat:enterprise_linux:10.0","fixed":["1:22.15.0-1.el10_0"],"introduced":["0"],"last_affected":[],"package":"nodejs-libs","purl":"pkg:rpm/redhat/nodejs-libs","source":"RHSA-2025:7502"},{"ecosystem":"Red Hat:enterprise_linux:10.0","fixed":["1:22.15.0-1.el10_0"],"introduced":["0"],"last_affected":[],"package":"nodejs-libs-debuginfo","purl":"pkg:rpm/redhat/nodejs-libs-debuginfo","source":"RHSA-2025:7502"},{"ecosystem":"Red Hat:enterprise_linux:10.0","fixed":["1:10.9.2-1.22.15.0.1.el10_0"],"introduced":["0"],"last_affected":[],"package":"nodejs-npm","purl":"pkg:rpm/redhat/nodejs-npm","source":"RHSA-2025:7502"},{"ecosystem":"Red Hat:enterprise_linux:10.0","fixed":["1:22.15.0-1.el10_0"],"introduced":["0"],"last_affected":[],"package":"nodejs22","purl":"pkg:rpm/redhat/nodejs22","source":"RHSA-2025:7502"},{"ecosystem":"Red Hat:enterprise_linux:10.0","fixed":["1:22.15.0-1.el10_0"],"introduced":["0"],"last_affected":[],"package":"nodejs22-debuginfo","purl":"pkg:rpm/redhat/nodejs22-debuginfo","source":"RHSA-2025:7502"},{"ecosystem":"Red Hat:enterprise_linux:10.0","fixed":["1:22.15.0-1.el10_0"],"introduced":["0"],"last_affected":[],"package":"nodejs22-debugsource","purl":"pkg:rpm/redhat/nodejs22-debugsource","source":"RHSA-2025:7502"},{"ecosystem":"Red Hat:enterprise_linux:8::appstream","fixed":["1:20.19.1-1.module+el8.10.0+23054+5431297f"],"introduced":["0"],"last_affected":[],"package":"nodejs","purl":"pkg:rpm/redhat/nodejs","source":"RHSA-2025:4461"},{"ecosystem":"Red Hat:enterprise_linux:8::appstream","fixed":["1:20.19.1-1.module+el8.10.0+23054+5431297f"],"introduced":["0"],"last_affected":[],"package":"nodejs-debuginfo","purl":"pkg:rpm/redhat/nodejs-debuginfo","source":"RHSA-2025:4461"},{"ecosystem":"Red Hat:enterprise_linux:8::appstream","fixed":["1:20.19.1-1.module+el8.10.0+23054+5431297f"],"introduced":["0"],"last_affected":[],"package":"nodejs-debugsource","purl":"pkg:rpm/redhat/nodejs-debugsource","source":"RHSA-2025:4461"},{"ecosystem":"Red Hat:enterprise_linux:8::appstream","fixed":["1:20.19.1-1.module+el8.10.0+23054+5431297f"],"introduced":["0"],"last_affected":[],"package":"nodejs-devel","purl":"pkg:rpm/redhat/nodejs-devel","source":"RHSA-2025:4461"},{"ecosystem":"Red Hat:enterprise_linux:8::appstream","fixed":["1:20.19.1-1.module+el8.10.0+23054+5431297f"],"introduced":["0"],"last_affected":[],"package":"nodejs-docs","purl":"pkg:rpm/redhat/nodejs-docs","source":"RHSA-2025:4461"},{"ecosystem":"Red Hat:enterprise_linux:8::appstream","fixed":["1:20.19.1-1.module+el8.10.0+23054+5431297f"],"introduced":["0"],"last_affected":[],"package":"nodejs-full-i18n","purl":"pkg:rpm/redhat/nodejs-full-i18n","source":"RHSA-2025:4461"},{"ecosystem":"Red Hat:enterprise_linux:8::appstream","fixed":["0:3.0.1-1.module+el8.10.0+22904+d0fedeff"],"introduced":["0"],"last_affected":[],"package":"nodejs-nodemon","purl":"pkg:rpm/redhat/nodejs-nodemon","source":"RHSA-2025:4461"}],"prev":{"headline":"TEIGarage XML External Entity (XXE) Injection in Document Conversion Service","id":"CVE-2025-31497"},"products":["c-ares"],"published":"2025-04-08","related":[],"sources":[{"class":"attribution","licence":"MIT","name":"AlmaLinux","prefix":"ALSA"},{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"Red Hat","prefix":"RHSA"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-04-08","vendors":["c-ares"]},"summary":"A use-after-free in c-ares allows remote or local attackers to cause denial of service or potentially execute code via crafted DNS responses.","url":"https://insights.sbomify.com/CVE-2025-31498/"}