Описание
Net::DNS versions before 1.57 for Perl allow memory exhaustion via unbounded recursion in sig_data when re-encoding a message with a misplaced TSIG record.
sig_data signs a message by re-encoding it, and removes TSIG records only from the additional section. A TSIG decoded into the answer or authority section survives that step and is signed again, so encoding re-enters sig_data with no termination condition. Decoding does not reject such a message: a TSIG that is not the last record on the wire raises "misplaced or corrupt TSIG", but the error is caught, reported as a warning, and the record is left in the packet. RFC 8945 section 5.2 requires the message to be dropped.
The recursion is reached only when the decoded TSIG carries an empty MAC, since a MAC recovered from the wire short-circuits the signing step. It is reached only from code that re-encodes a message it decoded, such as a forwarder or a proxy. A decoded message that is never re-encoded is unaffected. Message direction does not matter: a query reaches the same path as a response.
Each cycle re-encodes the whole message, so fewer than 100 bytes on the wire exhaust available memory and terminate the process.
A flaw was found in Net::DNS versions before 1.57 for Perl. An attacker can cause a denial of service (DoS) by sending a specially crafted DNS message with a misplaced Transaction Signature (TSIG) record. When a system using Net::DNS, such as a forwarder or proxy, attempts to re-encode this message, it can lead to unbounded recursion and memory exhaustion, ultimately terminating the process. This vulnerability arises because the sig_data function fails to properly remove TSIG records from all sections of a DNS message, violating RFC 8945 section 5.2 requirements.
Меры по смягчению последствий
To mitigate this issue, restrict network access to DNS services utilizing perl-Net-DNS to trusted clients or internal networks only, thereby limiting exposure. If the DNS service is not required to act as a forwarder or proxy, disable this functionality to prevent the vulnerable code path from being exercised.
Затронутые пакеты
| Платформа | Пакет | Состояние | Рекомендация | Релиз |
|---|---|---|---|---|
| Red Hat Enterprise Linux 6 | perl-Net-DNS | Out of support scope | ||
| Red Hat Enterprise Linux 7 | perl-Net-DNS | Affected | ||
| Red Hat Enterprise Linux 8 | perl-Net-DNS | Affected | ||
| Red Hat Enterprise Linux 9 | perl-Net-DNS | Affected |
Показывать по
Ссылки на источники
Дополнительная информация
Статус:
EPSS
7.5 High
CVSS3
Связанные уязвимости
(Net::DNS versions before 1.57 for Perl allow memory exhaustion via unb ...)
Net::DNS versions before 1.57 for Perl allow memory exhaustion via unbounded recursion in sig_data when re-encoding a message with a misplaced TSIG record. sig_data signs a message by re-encoding it, and removes TSIG records only from the additional section. A TSIG decoded into the answer or authority section survives that step and is signed again, so encoding re-enters sig_data with no termination condition. Decoding does not reject such a message: a TSIG that is not the last record on the wire raises "misplaced or corrupt TSIG", but the error is caught, reported as a warning, and the record is left in the packet. RFC 8945 section 5.2 requires the message to be dropped. The recursion is reached only when the decoded TSIG carries an empty MAC, since a MAC recovered from the wire short-circuits the signing step. It is reached only from code that re-encodes a message it decoded, such as a forwarder or a proxy. A decoded message that is never re-encoded is unaffected. Message direction
Net::DNS versions before 1.57 for Perl allow memory exhaustion via unb ...
EPSS
7.5 High
CVSS3