Cloudanix VulnDB

CVE-2024-25638

High · 8.9

CVSS

8.9

EPSS

0.4%

Published

Jul 22, 2024

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A widely used Java tool for looking up internet addresses fails to check that answers it receives actually match the question it asked, letting attackers slip in wrong addresses that could send users or services to the wrong places.

Chainable
Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
High
Impact
Data Tampering
Component
Library
Class
Improper Input Validation
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

The library accepts DNS resource records in replies without verifying they match the original query's name, type, or class, enabling injection of records from unrelated zones into resolver responses.

Why it matters to the business

Applications relying on this DNS library can be tricked into using attacker-supplied addresses or data, leading to traffic redirection, service disruption, or exposure of internal systems; the issue affects many Java projects that depend on dnsjava, increasing the scope of potential impact across the ecosystem.

How an attack unfolds

An attacker positioned to observe or influence DNS traffic sends a crafted reply containing resource records from a different zone; because the library performs no relevance validation, these extraneous records are processed and cached or returned to the calling application, allowing subsequent queries to resolve to attacker-controlled endpoints.

How to fix it

Upgrade dnsjava to version 3.6.0 or later (commit fd1d7c9280986ebb219c421695a902559aaeda22). For the affected Ubuntu package, apply the listed fixed versions. Validate that all direct and transitive dependencies are updated and test DNS resolution behavior after deployment.

How to confirm the fix worked

Confirm the dnsjava version in use matches or exceeds 3.6.0, review application dependency manifests, and perform controlled DNS queries to verify that only relevant records from the queried zone are accepted.

Typical attack path

  1. Identify an application using the vulnerable dnsjava library for DNS resolution
  2. Observe or trigger a DNS query from the target
  3. Craft and transmit a UDP or TCP DNS response containing resource records from an unrelated zone
  4. Have the library accept and use the injected records for subsequent operations
  5. Redirect application traffic or obtain unauthorized data via the poisoned responses

How to detect it

Examine DNS resolver logs and application debug output for responses containing resource records whose names or zones do not match the original query; correlate with network captures showing unsolicited or out-of-zone records accepted by the resolver.

What your security team should do

  • Immediately inventory all Java applications and services that depend on dnsjava and prioritize upgrades to 3.6.0
  • Implement network-level DNS query monitoring to detect anomalous responses during the remediation window
  • Add dependency scanning to CI/CD pipelines to prevent reintroduction of vulnerable versions
  • Review logging configurations to ensure DNS response details are captured for future incident response

The record

dnsjava is an implementation of DNS in Java. Records in DNS replies are not checked for their relevance to the query, allowing an attacker to respond with RRs from different zones. This vulnerability is fixed in 3.6.0.

Affected packages

Ecosystem Package Introduced Fixed
Maven dnsjava:dnsjava 0 3.6.0
Chainguard apache-nifi 0 2.0.0-r0
Chainguard apache-nifi-compat 0 2.0.0-r0
Chainguard apache-nifi-toolkit 0 2.0.0-r0
Chainguard druid-compat 0 34.0.0-r6
Chainguard hadoop-client-modules 0 3.3.6-r8
Chainguard spark-3.5 0 3.5.7-r2
Chainguard spark-3.5-scala-2.12-compat 0 3.5.7-r2
Chainguard spark-3.5-scala-2.12-iamguarded-compat 0 3.5.7-r2
Chainguard spark-3.5-scala-2.13-compat 0 3.5.7-r2
Chainguard spark-fips-3.5 0 3.5.4-r17
Chainguard spark-fips-3.5-scala-2.12-compat 0 3.5.4-r17
Chainguard spark-fips-3.5-scala-2.13-compat 0 3.5.4-r17
Chainguard tez 0 0.10.4-r6
Debian:11 dnsjava 0 No fix
Debian:12 dnsjava 0 No fix
Debian:13 dnsjava 0 3.6.2-1
Ubuntu:16.04:LTS dnsjava 0 No fix
Ubuntu:18.04:LTS dnsjava 0 No fix
Ubuntu:20.04:LTS dnsjava 0 No fix
Ubuntu:22.04:LTS dnsjava 0 No fix
Ubuntu:24.04:LTS dnsjava 0 No fix
Ubuntu:24.10 dnsjava 0 No fix
Ubuntu:25.04 dnsjava 0 No fix
Ubuntu:25.10 dnsjava 0 No fix
Ubuntu:Pro:16.04:LTS dnsjava 0 No fix
Ubuntu:Pro:18.04:LTS dnsjava 0 No fix
Ubuntu:Pro:20.04:LTS dnsjava 0 No fix
Wolfi apache-nifi 0 2.0.0-r0
Wolfi apache-nifi-compat 0 2.0.0-r0
Wolfi apache-nifi-toolkit 0 2.0.0-r0
Wolfi druid-compat 0 34.0.0-r6
Wolfi spark-3.5 0 3.5.7-r2
Wolfi spark-3.5-scala-2.12-compat 0 3.5.7-r2
Wolfi spark-3.5-scala-2.12-iamguarded-compat 0 3.5.7-r2
Wolfi spark-3.5-scala-2.13-compat 0 3.5.7-r2
Wolfi tez 0 0.10.4-r6

Related vulnerabilities